Bad dreams can also have good sides - one study says that nightmares help us control our fear while we are awake.
Scientists from universities in Switzerland and the United States have studied how the brain reacts to different types of dreams.
They found that bad dreams positively affect how we react to frightening experiences in the waking state.
However, there is a limit - traumatic nightmares disrupt sleep and have no positive effect.
How to sleep "like a man"
Should employees be allowed to take a nap at work
Research by neuroscientists from the University of Geneva, the University Hospitals of Geneva in Switzerland and the University of Wisconsin in the United States shows that dreams can also be used as a type of therapy for anxiety disorders.
Dreams "prepare us for danger in real life"
Scientists have tried to answer the question of whether moderately frightening dreams have a purpose.
With more than 250 electrodes connected to 18 subjects - and another 89 people who recorded when they slept and what they dreamed - the researchers investigated how the emotions we feel while sleeping are related to feelings in the waking state?
The results, published in the scientific journal Mapping the Human Brain, showed that bad dreams help people "react better in frightening situations."
Make up for the lack of sleep during the week on weekends
They found that the area in the brain in charge of controlling reactions to fear was more effective after poor sleep.
This suggests that nightmares prepare people to deal with fear when awake.
The more often we have nightmares, the higher the level of activity in the part of the brain that manages fear, scientists have discovered.
"We were especially interested in fear. What parts of our brain are activated when we have bad dreams? ”Said Lampros Perogamvros, a researcher at the Laboratory for Sleep and Cognition at the University of Geneva.
Emotions of nightmares
Scientists say that they have established a "very strong connection between the emotions we feel in sleep and in reality", and that bad dreams could be a kind of simulation of frightening situations and rehearsals for such experiences when we are awake.
"Dreams can be considered as real training and can potentially prepare us to face dangers in real life," Perogamvros said.
Why we have nightmares
But there is a limit, researchers say. If bad dreams become so terrible that we can describe them as traumatic nightmares, the benefits are lost. In these cases, scientists say, we have disturbed sleep and the "negative impact" of the nightmare continues after waking up.
"If a certain amount of fear is overcome in a dream, it loses the useful role of an emotional regulator," Perogamvros said.
Thanks God I did not have many times nightmares.I like dreaming.But not nightmares,it scares me.If I have nightmares I am wet on my body.Uf,I do not want even think about this.