We have all wondered what it will be like to die, and what – if anything – might happen afterwards. The prospect of no longer existing seems so difficult to accept that cultures throughout history have developed spiritual and religious beliefs about the persistence of consciousness after the body's physical demise. Back in the 17th century, René Descartes famously proposed that "mind stuff" (res cogitans) has a separate form of existence from "material stuff" (res extensa), thus introducing the thorny problem of how they might interact, and whether one might exist without the other.

Beliefs about persisting consciousness have been reinforced by reports of unusual "near-death experiences", which often involve the feeling that the soul has left the body and is approaching another reality characterised by bright light and blissful feelings. Now neuroscience has got in on the act, with a remarkable study by Jimo Borjigin and colleagues from the University of Michigan showing a transient surge in brain activity after the heart stops.

Most neuroscientists would be very sceptical of claims that consciousness of any sort could exist independently of a living brain. There is a growing consensus that consciousness, like life, weather, and cricket, is just another part of the natural world – albeit one that is reluctant to divulge its secrets. But it is unwise to dismiss reports of near-death experiences, which are usually reported after traumatic life-threatening events such as heart attacks. What's impressive is that these experiences are very consistent across individuals and even across cultures. I take this to mean that the people actually do have the experiences they say they have.

The challenge for science is to explain how the brain generates these kinds of unusual experiences without assuming that consciousness can exist independently of the brain. Take the related phenomenon of "out of body experiences", in which people experience themselves as being spatially separated from their body. The fact that people reliably report these events (sometimes as part of near-death experiences) does not mean their conscious self must literally leave their body to float around somewhere near the ceiling. We now know that similar experiences can be induced by electrically stimulating particular parts of the brain, or even by the clever use of virtual reality technology.

Some estimates suggest that up to one in five cardiac arrest survivors have near-death experiences, and given the traumatic contexts in which they occur it's not surprising they are sometimes interpreted as "proof" of heaven or of some sort of afterlife. In reality, though, all aspects of these experiences can likely be explained just in terms of normal brain functions gone awry. Out-of-body experiences depend on the brain making the best guess of where its body is, based on sensory inputs. The so-called "tunnel of light" is not a stairway to heaven: it is probably caused by reduced blood flow to the retina and visual cortex (as occurs at high G-forces for test pilots). Abnormal activation of different brain regions, similar to what happens when dreaming, could account for re-experienced memories. Even strange phenomena such as an awareness of being dead or seeing other apparently dead people can be related to similar delusions and hallucinations in other clinical conditions.

Despite all this, little has been known about what happens in the brain immediately after the heart stops beating. To address this, Borjigin's team induced heart attacks in anaesthetised rats and, surprisingly, found that brain activity continued after cardiac arrest, with some features actually becoming more prominent in the subsequent 30 seconds. Although these results are from rats and (fortunately) not people, they suggest the brain may have a final electrical "hurrah" as it shuts down. If the same thing happens in humans, it might account for some other aspects of near-death experiences, such as heightened alertness.

Looking ahead, the Michigan team's work lays new foundations for a deeper scientific understanding of the unusual changes in the brain that accompany some of our more remarkable experiences. It also underlines that death is not an event but rather a process, something I became personally aware of while sitting with my father as he died earlier this year.

What is it like to die? We still don't know, but now there is even less reason to invoke the paranormal, supernatural, or theological in shaping an explanation. And to me this only increases the wonder of life and of all the experiences it holds, even as it comes to an end.