I had a dream a killer ostrich kept chasing me and biting my legs and arms. But I finally got the better of it by grabbing it and throwing it up in the air and having a guy shoot it with a machine gun.
I believe that dreams are generated from the brain, about things that have happened during the day. These things get twisted dependant on what goes through your mind the minute before you fall alseep.
Actually, I think that's the phase where your brain is trying to shut the body down. It happens before you start dreaming and shortly after (unless you suddenly wake up)