You’re freaked out. A strange person or animal—or thing—is pursuing you. It draws nearer, but you wake up just before it has the chance to get you.

It may sound like a cliché. But experts who study nightmares say this is a pretty typical bad-dream scenario. “There’s often some threat of death or injury or annihilation, and you’re trying to escape,” says Tore Nielsen, a professor of psychiatry at the University of Montreal and director of the Dream and Nightmare Laboratory there. If you’ve experienced a traumatic event—a car accident, maybe, or military combat—it’s also common for your nightmares to rehash these specific situations.

But nightmares come in all shapes and sizes, Nielsen says. In some instances, a bad dream’s setting or events may be innocent, but the emotions the dreamer feels are ones of terror, disgust or distress, he explains. For that reason, when nightmares are frequent and distressing, they can cause real health trouble.

Looking to improve your sleep? Subscribe to TIME’s guide for answers to all your burning sleep questions.

“When you have a lot of nightmares,”—roughly one every night—”that can lead to stress and insomnia,” says Michael Nadorff, an assistant professor of psychology at Mississippi State University and director of that school’s Sleep, Suicide and Aging Laboratory. Startled wake-ups are another common feature of a clinical nightmare disorder, he says. (Some researchers say startled waking differentiates true nightmares from mere bad dreams, but Nadorff says he doesn’t draw a hard line between the two.)

“For people who have significant nightmare problems, it’s also common is for these individuals to actively try to avoid sleep in order to avoid having nightmares,” he says. “When they do have [a nightmare], they often don’t sleep for the rest of the night.”

This lost sleep has “massive” implications for a person’s health, he says. Chronic poor sleep can cause a whole range of mental and physical health issues, including depression and heart disease. Nadorff has also published research linking nightmares to suicidal thoughts and attempts.

He says nightmares tend to show up much more in those with depression, anxiety and other mental health disorders. Research has also shown that treating a person’s nightmares can lead to significant improvements in their sleep, PTSD-related stress and other suicide-linked mental health disorders—all of which suggests that nightmares aren’t simply a side effect of these conditions, Nadorff says.

But nightmares, while scary, aren’t always a bad thing.

In many cases, they may help the dreamer ameliorate some of their daytime anxieties. Research has found that nightmares can help some people learn to better manage stress. “We’ve known since Freud’s time that our current concerns are reflected in our dreams,” Nielsen says. Recording and “working through” bad dreams with a therapist can reveal a nightmare’s emotional connections to daily life. Far from being the stuff of pseudoscience, dream analysis seems to be a legitimate way to gain personal insights into our emotions and fears, he says.

MORE: How Dream Therapy Can Change Your Life

Along with providing these insights, nightmares may also act as a kind of built-in “exposure therapy,” which is now considered the gold standard for treating many phobias and some PTSD-related conditions, Nadorff says. For example, if someone is terrified of dogs, exposure therapy might involve spending time in a room with a counselor and a pooch. By confronting the source of his fear in a safe setting, the person learns to manage that phobia. In much the same way, nightmares—especially those following an upsetting event—may allow a person’s brain to relive the event and move past it, Nadorff says.

But that’s not always the case. “During exposure therapy, the worst thing you can do when someone is very anxious is to let them out of the [scary] situation when anxiety is still high,” he says. This escape reinforces fear by showing the person’s brain that running away will fix the situation. If a person has a recurring nightmare—but wakes up just before the really bad thing happens—all this can heighten that person’s fear response, he says.

You’ll know if your nightmares are unhealthy if they disturb your sleep on a regular basis, or if they seem to be fueling something that scares or unsettles you. There are two main treatment options to discuss with a doctor, Nadorff says. One is a blood pressure medication called prazosin, which “calms down the body’s stress response,” Nadorff says. “But if you discontinue use, nightmares tend to come back.”

The second treatment is known as imagery rehearsal therapy. “We have the person talk through their nightmare and change it in a way that’s not threatening, and then they practice the new dream during the day using visual imagery,” Nadorff explains. This kind of daily rehearsal can help reshape the scary dream even while a person is sleeping.

You may not be keen to confront your bogeyman—even during the daytime. But when it comes to nightmares, facing the source of your fear seems to be the best way to shrink it down to size.

More Must-Reads From TIME

Contact us at