Half of the volunteers did the test during the day, but the other half did it at night, so they slept between viewings. Those who slept found the pictures less frightening, the journal Current Biology reports.
In addition, MRI scans showed a dramatic reduction in activity in the amygdala, the part of the brain that regulates emotions and detects potential threats.
Other tests linked the reduction in fear to a drop in the stress hormone norepinephrine, also known as noradrenaline, while in the REM, or dream, phase of sleep.
University of California researcher Matthew Walker said: "We know that during REM sleep there is a sharp decrease in levels of norepinephrine, a brain chemical associated with stress.
"By reprocessing previous emotional experiences in this neurochemically safe environment, we wake up the next day and those experiences have been softened in their emotional stress. We feel better about them, we feel we can cope.
"The dream phase of sleep provides us with a form of overnight therapy, a soothing balm that removes the sharp edges from the prior day's emotional experiences."
As well as providing clues as to why we dream, the findings shed light on post-traumatic stress disorder and its recurring nightmares.
In PTSD sufferers, high levels of noradrenaline may stop this natural 'dream therapy' from working properly - meaning traumatic experiences remain raw when they are awake and asleep.
Doctors had previously shown that a certain blood pressure drug can help reduce nightmares for those who have PTSD. The drug reduces noradrenaline as a side effect, meaning it calms the brain during REM sleep.
Dr Walker said: "This study can help explain the mysteries of why these medications help some PTSD patients and their symptoms as well as their sleep. It may also unlock new treatment avenues regarding sleep and mental illness."
- DAILY MAIL