The most common causes of nightmares are stress and anxiety. If you are stressed before you sleep, your body tends to relieve any pressure you feel through bad dreams. Anxiety, on the other hand, makes you face your greatest fears while asleep. For example, if you are afraid of heights, you could dream about being stuck on top of a high building where the only option is to jump in order to get down.
Certain activities that you do prior to sleeping may also be a cause for nightmares. Watching horror films and reading suspense novels may make your mind remember some striking scenes which scared you the most. As you go to sleep, your memory plays these scenes in your mind, thus, causing you to have a really bad dream.
RE: Demons and monsters in inner and outer dimensions - nightmares explained