One evening in the year 1745, a distinguished scientist was dining in a private room at a tavern in London, when suddenly he noticed a man sitting in a corner and apparently speaking to him. Fearing for his sanity, the scientist hurried home and fell asleep. Later that night, the man from the tavern appeared in the scientist’s dreams claiming to reveal the meaning of the Bible as God himself. That scientist, Emanuel Swedenborg, then aged 57, went on to write several books about the revelation, inspiring followers and a new religious movement. During its heyday in the United States in the 19th century, Swedenborgism claimed most of the New England Transcendentalists, including Ralph Waldo Emerson. The Swedenborgian religion persists today with some 30,000 adherents around the world.

Many religions began as a dream or vision in the mind of the founder. Saul of Tarsus was on his way to Damascus to persecute the fledgling Christian community when ‘suddenly a light from heaven’ flashed around him. He fell to the ground and heard a voice say to him:

Saul, Saul, why do you persecute me? … I am Jesus… Now get up and go into the city, and you will be told what you must do.

After this vision, Saul became St Paul, and spent the rest of his life co-founding Christianity.

The prophet Muhammad, the founder of Islam, received his first revelation in a series of dreams. Hadith recounts that: ‘The commencement of the Divine Inspiration to Allah’s Messenger… was in the form of good dreams which came true like bright daylight…,’ culminating in the vision of the angel Gabriel commanding him to read the first verses of what would become the Quran. Similarly, the night before his enlightenment, the Buddha experienced his ‘five great dreams’. In the first of these, the Earth was his couch; Himalaya, king of mountains, was his pillow; and his hands and feet lay in the oceans. Buoyed by the visions, the Buddha performed his ritual morning cleansing and then sat down under a Bodhi tree until the visions in his dreams were realised and he famously ‘woke up’.

The list goes on and on. Joseph Smith, the founder of the Mormon religion, was visited by the angel Moroni on the night of 21 September 1823:

After I had retired to my bed for the night… I discovered… a personage appeared at my bedside, standing in the air… He had on a loose robe of most exquisite whiteness… His whole person was glorious beyond description, and his countenance truly like lightning.

The dream image of Moroni is said to have led Smith to a hill near Cumorah, New York, where he reports finding the sacred, buried founding documents of the Church of Jesus Christ of Latter-day Saints.

In a 1940s report, a shaman of the aboriginal Wind River Shoshoni tribe said that bears in his dreams gave him vital medicinal information and cures. Like other shamans and religious experts throughout the aboriginal world, he appeared to control his dreams and use them as a source of magic, knowledge and social prestige. Control over one’s dreams meant that one had some control over access to the supernatural realm – and that was considered an extraordinary feat.

Most people throughout history, not just healers and the founders of religions, considered dreams a portal into the spirit realm. When one of our ancestors living 100,000 years ago in Africa or the European Upper Paleolithic experienced a recently deceased loved one as startlingly alive in a dream, that individual would naturally believe that the loved one still lived on somehow, though without his or her old body.

Visitation dreams still remain so real that former atheists sometimes undergo conversion after experiencing them, as illustrated by reports I’ve been collecting for years. One avowed atheist and academic communicated the following dream to me in April 2015:

My long-dead father approached me in a kind of vast room. He appeared as he was when he was healthy. In fact, he seemed radiantly healthy. I remember thinking: ‘How could that be?’ as he was dead. He was smiling and all of sudden I just understood that he was really not dead at all but was instead alive and all right wherever he was… I began to feel that my atheism was not the whole story.

It is no wonder then that most people from across most cultures and all of history have treated dreams as direct evidence of a spirit realm. And that raises an obvious question: what is it about dreams that make them such potent vehicles for the supernatural?

We know that rapid eye movement sleep (REM), when eyes move rapidly back and forth under closed eyelids, is the phase when we have the most vivid dreams. REM is associated with heightened levels of the neurotransmitters dopamine (associated with reward and movement) and acetylcholine (associated with memory), as well as a surge of activity in the limbic system, the amygdala, and the ventromedial prefrontal cortex, all areas of the brain that handle emotion. Conversely, there is lowered activity in the dorsolateral prefrontal cortex, the area of the brain that handles personal insight, rationality and judgement; likewise, the neurochemicals noradrenaline and serotonin, involved in vigilance and self-control, are regulated down. The very low levels of serotonin allow steady release of the excitatory transmitter glutamate, which overstimulates the brain activity thought to underlie the cognitive and perceptual effects of hallucinogens. In other words, in REM sleep, our emotional centres are overstimulated while our reflective rational centres are impeded or narrowly refocused on issues of emotional significance. We are left free to ponder the endless meanings of the emotions and interactions that we experience but we do so with wildly fluctuating levels of reflective insight.

It only makes sense that these REM-related brain changes are also associated with schizophrenia and the high of hallucinogenic drugs such as LSD. REM, schizophrenia and hallucinogens are all associated with the neurologic conditions that produce altered states of consciousness. The neurochemistry of dreams produces an emotionally intense state of mind in the absence of an ability to critically reflect on the images produced by that state. When the hallucinatory REM dream or an acid trip ends, individuals can then reflect on and attempt to interpret the intense experiences they’ve just undergone.

Interpretative insight is more difficult (though not impossible) for the individual suffering from chronic schizophrenia.

The more intense the hallucinatory episode, the harder it is to interpret. The greater the interpretive difficulty, the more significance we impute to the experience – up to a point. That might explain why schizophrenics with positive hallucinations – including visual hallucinations, hearing voices, and delusions – report such high levels of religiosity, attempting to interpret their aberrant experiences through religious symbols, language and tropes.

Research confirms these reports. In one set of blind studies, the neuroscientist Roland Griffiths of Johns Hopkins University School of Medicine gave healthy volunteers either the stimulant drug methylphenidate or the hallucinogen psilocybin. Participants given the psilocybin had significantly higher scores on spirituality and mystical experiences; on the drug, they were much more likely than those given a stimulant to describe loss of personal boundaries, transcendence of time and space, deep personal insights, and a sense of contact with something exalted and ineffable. When the psilocybin participants were interviewed again 14 months later, 58 per cent said they rated the experience they’d had on the drug as among the five most personally meaningful of their lives; 67 per cent said it was in their top five spiritual experiences.

Dreams are transient ‘trips’: when they suddenly break through into waking life, they can become visions or hallucinations

In short, under the right conditions, hallucinogens such as psilocybin can produce intense spiritual and mystical experiences. They do so, in part, by producing the same neurochemical milieu (high dopamine and low serotonin in the brain’s limbic sites, and high glutamate in prefrontal sites) as found during REM sleep.

It is no wonder then that when we dream or when REM invades waking consciousness – as it does during periods of sleeplessness, stress, daydreams or acid trips – it can produce ‘visions’. Given all this, the phenomenological features of dreams and hallucinations of course overlap. Dreams, in short, are transient ‘trips’ and, when they forcibly and suddenly break through into waking life, they sometimes become visions or hallucinations.

If dreams and visions originate in the same neurobiology that produces psychedelic experiences, of course they can fuel religious experiences and ideas. REM sleep generates the combustible materials that fuel the fire of the religious imagination. Everyone dreams but not everyone has visions or becomes religious. What an individual does with the raw experience of the dream determines who will see visions and burn with enthusiasm for the supernatural, and who will not.

As we all know, dreams are notoriously open to interpretation. Every time we decide to ‘read’ a dream, we simultaneously anticipate brooding about the dream’s events and images several times throughout the day: after all, it is essentially impossible to understand a dream the first time through. Instead, we find in dream-interpretation two notable pivot-points, or phases: a ‘proleptic moment’, when you anticipate reflecting on its images and impact, and an ‘analeptic moment’, when the actual retrospective reflection on the images takes place. This sequence is seen because dreams often do not make any sense the first time round – or at least not any obvious sense.

This same paradoxical interpretative stance also occurs when we read sacred scriptures or listen to religious stories or attempt to interpret our own religious experiences (if we are ‘believers’). Indeed, as with dreams, sacred texts or religious experiences only rarely jibe with common sense. In general, they are not easy to understand. A believer will approach the reading or recitation of a sacred text via a commingling of both the proleptic and analeptic modes. Before the reading, the believer anticipates that he or she will need to reflect on its meaning later, but that anticipatory/proleptic experience itself colours the later interpretation of the text.

Ancestral populations very likely treated dreams, or at least some dreams, as communications from the supernatural realm. They therefore listened to them with awe and dread, and with the feeling that they would need to ponder the images reflectively for some time thereafter. And it was that proleptic/analeptic mood, first directed toward dreams, that fuelled the promiscuous production of new religious ideas. With religious experience, as with dreams, the activity of endless exegesis, interpretation and re-interpretation lead to new meanings, new ritual procedures and endless conflict.

Take for example the Christian doctrine of the virgin birth of Jesus. It is based on a dream that Joseph, the husband of Mary, had:

Now the birth of Jesus Christ took place in this way. When his mother Mary had been betrothed to Joseph, before they came together she was found to be with child from the Holy Spirit. And her husband Joseph, being a just man and unwilling to put her to shame, resolved to divorce her quietly. But as he considered these things, behold, an angel of the Lord appeared to him in a dream, saying: ‘Joseph, son of David, do not fear to take Mary as your wife, for that which is conceived in her is from the Holy Spirit. She will bear a son, and you shall call his name Jesus, for he will save his people from their sins.’ … When Joseph woke from sleep, he did as the angel of the Lord commanded him: he took his wife, but knew her not until she had given birth to a son. And he called his name Jesus.

The meaning of Joseph’s dream was interpreted by early Christian leaders to establish the doctrine of the Virgin Birth of Jesus, which later became a central tenet of the Christian faith for many Christians. The dream generated centuries of conflict between Christians and Jews over the claim of the virgin birth of Jesus, while Islam accepted the dream as definitive proof of the virgin birth. During the period of the Reformation in the West, conflicts over interpretation of this dream (and of course many other biblical passages) turned violent, with many lives lost but no resolution. Indeed, the meaning of the dream is still being disputed in Christian, Jewish and Muslim circles today.

Given the generative political potency of dream-interpretation for pre-modern societies, persons who could reliably interpret dreams were highly sought after in these cultures, and they gained considerable political prestige as religious seers or leaders. To become a holy man, one had to cultivate expertise in dream-interpretation. Joseph in the Hebrew scriptures is an exemplar of the holy man whose special gift is to interpret dreams.

Another, earlier biblical Joseph was able to get himself freed from the pharaoh’s prison by expertly interpreting the pharaoh’s dreams for him. In Genesis, we read:

Then Pharaoh said to Joseph: ‘Behold, in my dream I was standing on the banks of the Nile. Seven cows, plump and attractive, came up out of the Nile and fed in the reed grass. Seven other cows came up after them, poor and very ugly and thin, such as I had never seen in all the land of Egypt. And the thin, ugly cows ate up the first seven plump cows, but when they had eaten them no one would have known that they had eaten them, for they were still as ugly as at the beginning. Then I awoke. I also saw in my dream seven ears growing on one stalk, full and good. Seven ears, withered, thin, and blighted by the east wind, sprouted after them, and the thin ears swallowed up the seven good ears. And I told it to the magicians, but there was no one who could explain it to me.

Unlike the professional dream interpreters (the magicians) who could not understand why the pharaoh dreamt both about plenty and want, Joseph argued that the dream images referred to one thing: a message from God telling the pharaoh to store up food reserves during seven years of plenty, because those seven years of plenty would be followed by seven years of severe famine. Joseph prevailed in the conflict over the meaning of the pharaoh’s dream, and thus Egypt survived the seven years of famine that inevitably came. On the basis of his dream-interpretation abilities, Joseph became a leading official at the court of the pharaoh thenceforth.

What we do with the demonstration that spirituality is rooted in REM sleep and dreams is a personal – perhaps spiritual – choice

In short, not just dreams but dream-interpretation was central to the human experience and to the creation of religious movements and ideas throughout history. The raw experience of the dream and the intense work of interpretation explain why the spirit realm was considered absolutely real for most of humanity’s history. People directly experienced the spirit realm in their dreams.

Where does all this leave us today? On one hand, the link between REM dreams and spiritual experience disturbs some religious people because they fear it suggests that religion is nothing but delusional dreaming and hallucinations. On the other hand, the connection upsets some die-hard atheists, who dislike the idea that spirituality is rooted in our biology – that it is functional and adaptive, and central to who we are.

What we do with the demonstration that spirituality is rooted in REM sleep and dreams is a personal – perhaps spiritual – choice. But science and society itself would benefit from taking the connection seriously. If our dreams generate spiritual ideas, they might also contribute to a generation of religious-based terrorism and fanaticism. After all, REM sleep has been studied as a model for psychosis. The same chemical brew that produces the dream state can, if tweaked, produce obsessional psychoses and related neuropsychiatric symptoms. Religious fanaticism has a kind of obsessional and paranoid feel to it that links it with REM intrusion into waking life and the subsequent delusional states that follow. The future neuroscience of the spiritual, rooted in the study of dreams, could help us to confront some of our era’s greatest challenges.