Emma Young reports on the connection between sleeping badly and psychological disorders:

...during REM, production of serotonin and noradrenalin shuts down in the brain. Noradrenalin is the neurochemical associated with stress, fear and the flight response; it translates to adrenalin in the body. Serotonin modulates anger and aggression. "You get this beautiful biological theatre during REM sleep, where the brain can go back over experiences it has learned in days past, but can do so in a situation where there are none of these hyping-up neurochemicals," Walker says. So although dreams can be highly emotional, he thinks that they gradually erode the emotional edges of memories.

In PTSD this process seems to fail, so that traumatic memories are recalled in all their emotional detail. It is not clear yet why this happens, but there is evidence that people with PTSD have higher waking levels of noradrenalin and serotonin. This might mean that neurotransmitters cannot be damped down sufficiently during REM sleep for the emotional intensity of the memories to be stripped away, says Walker.