I do some of my best thinking when I'm asleep, or nearly so.
Anyone who knows me would probably not be surprised by that admission, but it never ceases to amaze me. I can't tell you how many times I have been stuck on a plot twist, or have written my protagonist into a corner which I have no idea how to get him/her out of, or can't come up with an original idea for a short story or novel, and as I'm drifting off to sleep, something comes hurtling out of nowhere and smashes me over the head.
Sometimes, of course, it's my wife trying to get me to stop snoring, but just as often it's the kernel of an idea that helps me figure out where I want to go with my story or novel. In the beginning, it would catch me by surprise. I would have no conscious memory of even thinking about writing, and yet I would suddenly visualize the solution to my dilemma with a clarity which approached "vision" status.
It has gotten to the point where I now make a conscious effort to dwell on the problem I'm experiencing in my writing as I feel myself beginning to drift off to sleep. Now don't get me wrong; I'm not going to try to make you believe that it happens all the time, or even most of the time. But it happens often enough that I know I can rely on my subconscious mind to help me out a pretty fair percentage of the time.
At first I would have a hard time remembering my "vision" when I woke up the next morning. My wife told me to keep a pen and paper next to the bed and write down my ideas, but honestly I am so close to falling asleep when they hit that I'm really not able to wake up enough to write them down. I've even lost a few. Now, though, I have gotten to the point where I am usually able to recall my "visions" from the previous night with little or no trouble.
I have to admit it's equal parts comforting and disturbing to know my subconscious mind has so much control over me. I assume we are all in the same boat in that regard, although maybe I'm just telling myself that so I won't worry too much about how close I am to occupying a rubber room with my arms tied into a straitjacket.
Sometimes I wonder what Freud would say about this whole thing, but then again, maybe it's better if I don't know.