Live Well
Getty Images
August 6, 2020 6:00 AM EDT

The scariest dream my now-college-age daughter ever had was the one about the running legs—or, as they became known in our family, The Running Legs, almost audibly capitalized. She was in kindergarten at the time and the dream amounted to little more than an image of a pair of black tights, filled by an invisible lower body chasing her.

It was the first thing she mentioned when she got up in the morning and she brought it up again over breakfast—clearly distressed. We talked about it a bit and I asked her what she thought the legs would have done if they had caught her.

“Bite me,” she answered.

“With what?” I asked.

That made her laugh, but not so much that she didn’t also mention the dream to her teacher, who had her draw a picture of it and then talk through it together. The fear faded after that, but the memory did not.

Silly or not, childish or not, The Running Legs checked several boxes that would generally qualify it as a nightmare. It was recalled upon awakening—and may even have been the reason for the awakening. It caused distress the next day. It involved danger—in the case of nightmares, it’s most commonly some kind of physical aggression, a serious accident, a disease, or, yes, being chased.

Nightmares may also involve being the person who causes harm to other people. “Humans are social beings,” says professor Michael Schredl, a sleep researcher at the Central Institute of Mental Health in Mannheim, Germany, and nightmares may be sign that a bit of the social code that keeps us in line during the day and is fundamental enough to who we are that it apparently operates even in our sleep. From the time we emerged as a species we have depended on our acceptance within a group for our very survival, and violating the rules of that group could mean banishment. “I think those nightmares point to that importance,” Schredl says.

It would be nicer for all of us if nightmares didn’t exist in the first place, but it’s hardly surprising that they do. If the sleeping brain is forever screening the sometimes absurdist movies that are our dreams, it’s no surprise that now and then it would choose a horror film. But there are open questions: why you have one on one night and not another; why some people suffer from them more than others; what the specific content of the bad dreams signifies.

Searching for a good night’s rest? Find it by signing up for TIME’s guide to the scientific secrets of sleep.

Researchers have long worked to answer those questions and in recent years have succeeded in unraveling at least some of the mysteries. What’s more, they are developing new, often high-tech ways to observe the sleeping brain as nightmares play out and even read some specific elements of the storyline or at least the imagery. There may even be a way to step in and change the nightmare narrative—stimulating the brain to allow the dreamer to take control of the experience, all the while remaining asleep.

Nightmares do not strike us all equally. According to a 2017 study of U.K participants published in Social Psychology and Psychiatric Epidemiology, about 5% of the overall population experiences a nightmare at least once a week, which is sufficiently frequent to qualify as a diagnosable disorder. A larger share of the population—30% to 55%—has an average of one nightmare a month, according to a Hong Kong-based study published in the journal Sleep. And the American Society of Sleep Medicine reports that around 85% of us report at least the occasional nightmare, a finding confirmed by multiple studies.

Where Nightmares Come From

The seeds of future nightmares may be planted early in life, during what’s known as the “infantile amnesia” period, which lasts from birth to about age three and a half, and is a time of life during which virtually no enduring memories are formed. Infantile amnesia gets disrupted, however, if the child experiences significant trauma during that sensitive time-window—physical abuse, witnessing domestic violence, or being placed in rotating foster care with no consistent attachment figures, to name a few examples. This can lead to what psychologist Tore Nielsen, of the University of Montreal, dubbed the Stress Acceleration Hypothesis (SAH), in a 2017 paper published in Frontiers of Neurology. The idea behind SAH is that early adversity of these sorts can accelerate the development of skills that govern fear and crisis management—which are useful for the child, but come at a long-term cost.

“The trauma leads to brain changes that help the child adapt short-term,” says psychologist and dream researcher Louis-Philippe Marquis of the University of Montreal, who had Nielsen as a thesis adviser. “But they may facilitate nightmares and psychopathology later in life.”

According to the SAH hypothesis, the originating trauma doesn’t have to be out of the ordinary; merely the birth of a sibling in the infantile amnesia window can make someone more prone to nightmares. And no wonder: the first child goes from being the sole focus of parental attention to having to share that love—and the new arrival usually gets the majority of the care, simply because infants are so demanding. In his 2017 paper, Neilsen wrote that firstborn children had frightening dreams more than twice as frequently as last-born children, regardless of potential confounders like age, sex, and number of siblings.

Other, less traumatic factors can contribute to nightmares too. In a 2018 study of 1,216 subjects, Schredl found that simple daily stress is a powerful causative factor. “All kinds of stress increase nightmare frequency,” Schredl says. “There don’t need to be any unrecognized issues in the subconscious.”

Individual temperament may also be a factor in the occurrence of nightmares. Schredly has found that people who score higher on tests of empathy and sensitivity are more likely to pay for daytime stress with a sleep-time nightmare. Research by Bryrony Sheaves, a clinical psychologist at the University of Oxford specializing in, among other things, sleep disturbances, has connected nightmares to a painful triptych of temperamental tendencies: paranoia, frequent depersonalization, and hallucinations. Sheaves stresses that in all of these cases she is not describing clinical conditions: some people are more suspicious than others; some tend to feel depersonalized in moments of social stress like walking into a party filled with strangers or delivering a speech; in the case of hallucinations, Sheaves is describing mostly people who experience vivid dreamlike imagery while falling asleep or waking up—the so-called hypnagogic or hypnopompic states. In all of these people, nightmares are likelier to occur more frequently.

“In reality, there is not one single cause for nightmares for most people,” says Sheaves. “The exception for that is if they’re part of a wider PTSD issue.” Among people with PTSD, or post-traumatic stress disorder—especially combat veterans and victims of sexual assault or other violence—anywhere from 71% to 96% report frequent nightmares, according to the U.S. Department of Veterans Affairs. Indeed, nightmares are one of the defining symptoms of the condition.

Just which parts of the brain serve as the projection booth for nightmares is uncertain. Marquis explains that the likeliest loci are the anterior cingulate cortex, hippocampus, amygdala, and medial prefrontal cortex. The anterior cingulate cortex plays a role in emotion, blood pressure, heart rate, morality and where we allocate our attention, all of which come into play during nightmares. The principal role of the hippocampus is to regulate and process memory—which helps vivid or traumatic experiences lived during the day or deeper in the past get replayed in dreams, especially in PTSD patients.

But the two biggest players in the cranial gang of four are the amygdala and the prefrontal cortex. The amygdala is in what amounts to the basement of the brain, both physically (it is deeply buried, not far from the brain stem) and functionally (it’s where the demons are kept, especially fear, aggression, anger and sadness). When we’re awake, the prefrontal cortex keeps a close watch on what all those emotions are up to downstairs. But, “during sleep, the frontal areas of the brain are shut down and the brake that actively suppressed the emotions in the amygdala during the day does not work properly anymore,” says Stephanie Rek, a PhD student and clinical trainee studying sleep at Ludwig Maximilian University in Munich. When the brain signs off for the night, the monsters come out to play.

Learning to Read the Contents of Dreams—and Nightmares

As awful as nightmares can be, they aren’t necessarily always a bad thing. New research into the brain regions involved in nightmares has found that in some cases a dream-time scare may even have some adaptive value.

In a 2019 study published in the open access journal Human Brain Mapping, a team led by Virginie Sterpenich, senior researcher at the University of Geneva’s Swiss Center for Affective Sciences, recruited 89 subjects and had them keep a dream diary for one week, in which they reported the contents of their dreams and the associated emotions, including fear, anger, sadness and disgust. Later, those subjects underwent functional magnetic resonance imaging (fMRI) while looking at pictures of faces with what the researchers had determined were happy, funny, or menacing or frightening expressions. When looking at the frightening or menacing faces, subjects who reported fewer nightmares in their dream diary, showed fMRI activity in the insular and midcingulate cortices of the brain, which more or less mirrored that of people having bad dreams. In subjects who reported more nightmares, those brain regions were less reactive to the negative images—effectively shrugging them off. The implication, according to Sterpenich and her colleagues: bad dreams experienced in the safety of the bed can actually serve to help us better handle genuinely frightening or threatening episodes in the real world.

More experimental—and more tantalizing—is research being led by Tomoyasu Horikawa and Guohua Shen, both of the Advanced Telecommunications Research Institute International in Kyoto, Japan, which may make it possible to use fMRI scans to actually peek at the visual content of subjects’ dreams. The premise, which they explored in depth in a 2019 paper in PLOS Computational Biology, first involves machine-learning—teaching a deep neural network to recognize an encyclopedic collection of images including animals, airplanes, faces, trees, mailboxes, cars and on and on. The researchers then used an fMRI to read the visual cortex of human subjects as they looked at or were instructed to imagine the same objects. Subjects were also allowed to fall asleep in an fMRI machine, then were awakened during the hypnagogic state and asked what images they had been seeing in their half-dreams. The fMRI data from those mind-pictures were when coded to their responses.

Then, the resulting database was put to the test: Subjects were placed back in the fMRI while looking at or imagining particular images and their brain readings were then fed into the deep neural network which would try to understand and recreate the images. It was startlingly accurate.

The face of a tiger or the picture of a tree that the machine spit out in response to the brain reading might be fuzzy or sloppy or need to be turned this way or that before it became clear just what it was, but all the same, the machine read many of the subjects’ brains and even in a rough way, saw what it was seeing. It’s too early to say what practical effect such a mind-reading system could have, but with the assistance of a therapist, it could be used to help those with regular nightmares work through the content of the dreams, as well as to habituate and desensitize them to the imagery.

Learning How to Control Nightmares

Another type of new technology might have an even more direct effect on mitigating nightmares. Known as transcranial stimulation, it involves introducing low levels of low-frequency energy into the frontal and temporal lobes of the brain. That has been experimentally shown to change ordinary dreaming into what’s known as lucid dreaming, most convincingly in a 2014 study published in Nature Neuroscience and led by Ursula Voss, a psychology professor at J.W. Goethe-University in Frankfurt Germany. In the lucid dream, the sleeping brain is aware that the experience is just a dream, can stand back from it and observe it like a third person and, in some cases, can take control of the narrative—turning around and chasing The Running Legs, say, instead of being chased by them. In Voss’s work, she and her team found that at key energy frequencies of 25 and 40 hertz, all three of those lucid dream states—awareness of the dream, a third-person perspective on it, and the ability to take control of it—could be achieved with greater frequency than among people who did not receive transcranial stimulation.

In a 2018 paper in the Journal of Sleep Research, an international team of scientists explored a number of lower-tech nightmare treatments now available. The paper, with 23 named co-authors, was the result of what Schredl describes as “the first nightmare conference worldwide,” and involved a sort of birds-eye view of the landscape of nightmare research. Based on their findings, the researchers agreed that one of the most powerful nightmare treatments is “desensitization and exposure,” in which patients are first asked to imagine the nightmare vividly and practice relaxation exercises, including steady breathing and alternately tensing and relaxing muscles throughout. Next, they are asked to imagine the nightmare and take no such therapeutic steps. The first exercise teaches them to take control of the experience, the second exposes them to the raw nightmare in a controlled setting, which, over time, can strip it of its power to cause distress.

Also effective, according to the 2018 study, is “image-rehearsal therapy” in which patients imagine the nightmare multiple times a day in a quiet and focused setting, but rescript it, giving it a different, happier ending in which, say, the tiger that’s chasing you turns into a kitten. It’s a simple, but apparently empowering method, with multiple studies in the 2010s showing that it can decrease nightmare frequency and severity—even among PTSD patients—and improve overall sleep quality. Cognitive-behavioral therapy in which people reframe certain beliefs about nightmares—for example, that the next day you will be haunted by memories of the experience—can also help diminish the shock and power of the dreams.

None of this will eliminate nightmares altogether. The brain is too creative and reactive and emotional a thing to serve up only good dreams. But our understanding of nightmares—and the technology to interpret and control them—is a new weapon in an old war. Dreaming itself may not change, but our response to it can.

Write to Jeffrey Kluger at jeffrey.kluger@time.com.

EDIT POST