I once read a good book on writing in which the author asks the question: "So, how do authors come up with those awesome plots where everything comes together in the end and creates a completely unexpected ending?"
His answer was: "I don't know."
But I know.
And I'll tell you. But first some background and setup:
There was once a PhD mathematician who solved one of the most famous problems in mathematics (I don't recall the exact nature of the problem, and probably neither of us would understand it in any case). It took him literally ten years of thinking about the problem from every possible angle to solve it.
And when he finally did, he explained to interviewers his process for thinking about this problem. It was simple, he said, he got up in the morning and began thinking about the problem. He carried it around in his head all day, thought about it while he ate, and with every article he read he tried to apply the concepts being discussed to his problem.
Other people thought him distracted perhaps, a bit weird, maybe even difficult to talk to--absent minded even. But they did not carry a problem with them like he did.
Another famous mathematician, Richard Feynman, followed the same technique. One his ex-wives said that being married to him was difficult because he was never fully there, he was always, always thinking about some problem in his head, even at the breakfast table, you could practically see differential equations flying through his mind.
My own father made a similar statement about me, saying that he realized that when I got quiet sometimes it was because I wasn't full with him, but thinking about this or that idea. So, I can relate to these other thinkers completely. And there is at least one idea that I've been thinking about continually now for 19 years at the date of this writing.
It all began with something that someone said to me back in grade school, a single sentence that is burned on my memory.
Ironically I can't remember exactly who said it, though it was an adult, only what was said. He said: "You don't own an idea until you write it down."
That thought stopped me completely, and I immediately realized it was one of the most valuable things I'd ever heard and I decided then and there to follow it. And since then, I have faithfully written down every idea I've ever had, since the age of 15.
I've discovered a side effect of this practice: it actually frees your mind to think of new ideas. And over the years I've come up with many bad or trivial ideas, some good ideas, and just a few absolute gems.
It is the gems that I carry around in my head all day long and am constantly thinking about, wondering how I could apply anything I encounter in real life to them.
Some of these are business ideas, some inventions, and others are story ideas.
Seeing a child playing might give me an idea for a character; watching a movie might suggest a scene to borrow and adapt; reading a book about writing may suggest a way to approach crafting an emotionally resonant theme in a story; being stymied by some problem might suggest space for an invention.
I can tell you right now that I am carrying around with me a nearly completed plot to the novel I'm working on now. The story lurks in the back of my mind, ever present, riding piggyback, always looking over my shoulder at what I look at, reading what I read, hearing what I hear, and soaking up constantly about 10% of my ever-present attention. And that's just one good idea.
I've got several short stories rolling around in there as well, some with more or less importance, and one in particular that I've made great progress on recently and which requires a near complete rewrite due to the rapid progress I've made on it conceptually.
Beyond that, it's perhaps scary to admit, but I've got two more entire novels, each designed to be the beginning of two independent series I am planning, each with at least a trilogy of novels behind them, and both of them real gems of a story, and each in various stages of completion.
And as I have ideas about stories, I write them down, maintaining a log-file of ideas as they materialize, which I can go back later and harvest for ideas as I write.
(And be sure to put a back-up strategy in place. I nearly lost all of my collection of writings to a hard-drive failure. Luckily, a sense of impending doom caused me to back them up the day before the drive failed.)
And that is how you come up with an amazing plot that creates a surprising inversion in the ending. By thinking about the story for so long, so consistently, that you out-think your reader. You consider all the angles. You don't settle for cliche plot or ordinary turns, you go beyond even your first, second, or third idea, and integrate all the elements thematically into a powerful ending.
This technique of carrying around your ideas with you continually is what I like to call the 'Genius Method', for it is how one becomes a genius. If there is a price for genius, that is it. You must devote yourself to a solution to a significant problem. Whether that is in mathematics, architecture, writing, or any other field. And when you produce a work of genius in the end, people may be amazed by it and they will think you're very smart. They will not see your devotion to a problem that led to your unique insights. They will simply label you a genius. When the truth is, anyone can be a genius, about anything.
The only thing that makes me sad is when I see stories about people who've taken the human capacity for genius, that everyone has, and spent it on frivolous things. Take Bobby Fischer, the renowned chess champion. Chess is ultimately unproductive, so he attained little more than entertainment value--which has some value to society in general, but is hardly the most significant thing he could've put his intellect to.