Since dreams are not predetermined, the brain responds to the situation by either thinking a good thought or a bad thought, and the dream framework follows from there. If bad thoughts in a dream are more prominent than good thoughts, the dream may proceed to be a nightmare.There is a view, possibly featured in the story A Christmas Carol, that eating cheese before sleep can cause nightmares, but there is little scientific evidence for this.Severe nightmares are also likely to occur when person has a fever, these nightmares are often referred to as fever dreams. Treatment
Sigmund Freud and Carl Jung seemed to have shared a belief that people frequently distressed by nightmares could be re-experiencing some stressful event from the past. Both perspectives on dreams suggest that therapy can provide relief from the dilemma of the nightmarish experience. Halliday (1987) grouped treatment techniques into four classes. Direct nightmare interventions that combine compatible techniques from one or more of these classes may enhance overall treatment effectiveness:
Analytic and cathartic techniques
Storyline alteration procedures
Face-and-conquer approaches
Desensitization and related behavioral techniques

Post-traumatic stress disorder
Recurring post-traumatic stress disorder (PTSD) nightmares in which traumas are re-experienced respond well to a technique called imagery rehearsal. This involves dreamers coming up with alternative, mastery outcomes to the nightmares, mentally rehearsing those outcomes while awake, and then reminding themselves at bedtime that they wish these alternate outcomes should the nightmares reoccur. Research has found that this technique not only reduces the occurrence of nightmares and insomnia, but also improves other daytime PTSD symptoms.
Estimates of median survival vary from 10 to 30 years, depending on whether hospital-based or population-based cohorts are studied. Epidemiology
LAM is almost completely restricted to women. While lung cysts consistent with LAM are reported in some men with tuberous sclerosis, very few of these men develop symptoms. The prevalence of LAM is estimated using data from registries and patient groups and is between 3.4 and 7.8/million women. The number of new cases each year is between 0.23 and 0.31/million women/year in the US, UK and Switzerland. The variation between countries and between adjacent states in the US, suggest that a significant number of women with LAM remain either undiagnosed or their symptoms are attributed to other diseases. Adult women with tuberous sclerosis are more likely to develop LAM than women without tuberous sclerosis. Cohorts of patients with tuberous sclerosis have been screened for LAM using CT scanning. In a retrospective study of adults with tuberous sclerosis, CT demonstrated lung cysts in 42% of 95 women and 13% of 91 men. In general, lung cysts were larger and more numerous in women than in men. In a further retrospective study of women with TSC who underwent CT scanning to detect LAM, 25% of those in their 20s had lung cysts whereas 80% of women in their 40s were affected, suggesting that the development of LAM is age dependent at least in tuberous sclerosis-related LAM.