Think of happy things before you go to bed ^_^
Well what I try to do is think of things that I like..such as..umm..
Final Fantasy for example, then maybe you'll end up dreaming about that.
Some times listening to music before you go to bed helps
Or even reading a book.
Anything that gets you relaxed and your mind of things.
I guess some of that might help for nightmares, but you most times you don't really have a choice. right?