Most dreams take place during REM (rapid eye movement) sleep, when your brain works hard at processing emotions, memories and cognition. Since we stay in REM sleep longer as the night progresses, nightmares are more likely to strike late at night or in the wee hours of the morning. Low quality sleep (often due to inconsistent bed times or watching TV in bed), stress and some medications can cause nightmares. So can eating too close to lights out, so if you’re plagued by bad dreams, steer clear of late night snacking.

READ MORE: What Nightmares May Comes (and How to Stop Them)