Popping hallucinogenic 'shrooms while facing death from a terminal illness sounds like a recipe for a really bad trip. But it turns out the experience it's quite the opposite for many people and can be a step toward fully living again.

“All of our subjects expressed a lot of gratitude that this opportunity was open to them,” says Dr. Charles Grob of the Harbor-UCLA Medical Center. The psychiatrist has been studying how psilocybin, the psychoactive component of "magic mushrooms," can reduce anxiety about death for cancer patients in the last months of their lives.

Many of the psychiatrist's patients "had lost their sense of meaning and purpose," Grob says. "We [thought] that not only might the experience help them to be less anxious and less depressed, it might also reconnect them with their core identity, which the illness often takes them away from.”

He says it was moving to sit with his patients for many hours "while they went deep into the experience — for the most part just lying quietly in bed, eyes closed, eyeshades on, headphones on, listening to music."

For most of the patients, it was their first time using hallucinogens. Grob checked in with each patient once an hour to measure blood pressure and make sure everything was going okay — while trying not to interrupt the effects. “I would encourage them to just go deep and [that] we would have lots of time later on to talk about what they were experiencing," he says.

Grob is hardly the first or only doctor working in this area. New York University’s Medical School and Johns Hopkins Bayview Medical Center have both run studies that administered psilocybin to cancer patients. “This research is in its very early stages,” Grob told the New York Times, “but we’re getting consistently good results.”

Patients who had been suffering severe anxiety or depression before taking psilocybin reported having a more positive view of their circumstances, and even a renewed sense of peace and gratitude.

One patient “had been isolating herself from friends, had kind of retreated from the world, waiting to die,” according to Grob. Her experience on psilocybin "opened the floodgates" and connected her with powerful feelings about her deceased father.

The patient had been on an antidepressant prior to the study, but afterwards she felt she didn't need it. “For her, it was a very healing experience, and afterwards her anxiety was much diminished," Grob says. The time on psilocybin seemed to have restored an equilibrium to her mental state that she had lost as she approached death.

The experience also sometimes repaired relationships with people who were close to patients. “I've had some subjects whose important relationships seem to be on the rocks, with the stress of what was going on,” Grob explains.

“After their treatment, at least with some of our subjects, it was quite moving to see the manner in which they were able to connect and bond with their significant other and other family members.”

Grob is now thinking about offering the same treatment to the partner of the person who is dying. “That person is also quite often in crisis. For them, denial has been stripped away,” Grob says. “It [might] help them prepare for the grieving process. I think that might be an interesting model to work with next.”

This article is based on a story that aired on PRI's To The Best of Our Knowledge, reported by Charles Monroe-Kane