From LiveScience:
About 5 percent of dying patients and 10 percent of cardiac arrest patients describe having near-death experiences. These experiences often have similar elements, such as a feeling of being out-of-body, going through a tunnel or on a river toward a warm light, seeing lost loved ones and being told it's not time to go yet. Past research revealed that near-death experiences are more vivid than real life. But scientists strongly disagree about the source of these experiences. Some argue that near-death experiences reveal the existence of heaven or the duality between mind and body, while others claim the event is caused by a flood of chemicals in the dying brain.
To sort out the issue, Borjigin and her colleagues examined nine rats. They induced cardiac arrest while the animals were hooked up to EEG machines, and the team then measured the electrical activity in the animals' brains. About 30 seconds after the heart had stopped, all the animals experienced waves of synchronized brain activity that were characteristic of the conscious brain. Rats that were asphyxiated with carbon monoxide showed a similar pattern of brain activity. The rats' visual cortex, which processes visual imagery, was also highly activated. This could shed light on why NDEs are so vivid, Borjigin said. “They all show the fingerprints of neural consciousness at near-death is at a much higher level compared to the waking state. That explains the realer-than-real human experience,” Borjigin told LiveScience. The team believes that this electrical surge may be a mechanism the brain uses to rescue itself from a sharp drop in glucose and oxygen. Though it may not work for animals in cardiac arrest, Borjigin speculates that this mechanism spurs alertness or hyperawareness in less critical situations.
More here.