They aren't drugs you'd ever expect to see scribbled on a doctor's prescription pad: ecstasy, "magic" mushrooms, ayahuasca.

But in recent years, a number of small studies have explored the potential for psychedelic drugs to treat certain mental health conditions. And the results suggest that, along with talk therapy, the drugs may benefit some people.

"Combined with [talk therapy], some psychedelic drugs like MDMA [or ecstasy], psilocybin [the active ingredient in magic mushrooms] and ayahuasca may improve symptoms of anxiety, depression and post-traumatic stress disorder [PTSD]," Cristina Magalhaes, an associate professor of clinical psychology at Alliant International University in Los Angeles, said in a statement. Magalhaes co-chaired a symposium on psychedelics and psychotherapy on Aug. 9 at the annual meeting of the American Psychological Association (APA) in San Francisco.

Still, more research and discussion are needed to better understand the possible benefits of the drugs, as well as the ethical and legal issues surrounding their use, Magalhaes said. (Many psychedelic drugs, including the three addressed in the symposium, are illegal in the United States and are available only for patients in research studies.) [Trippy Tales: The History of 8 Hallucinogens]

Here's a look at why these three psychedelic drugs show promise for treating mental health conditions:

MDMA

Research will soon begin a large-scale study of MDMA, the active ingredient in the drug ecstasy, along with talk therapy, for the treatment of PTSD. The "Phase 3" study, which will include at least 230 people, is the final step needed before MDMA can be approved as a prescription drug, according to The New York Times.

The combination of this drug and talk therapy has already shown benefits in smaller studies of patients with PTSD who did not respond to other treatments.

Researchers think that MDMA may help people with PTSD by improving how they respond when they undergo talk therapy, Dr. Michael Mithoefer, a psychiatrist in private practice in South Carolina who has studied MDMA, told Live Science in a 2016 interview.

MDMA may also have benefits for some people with autism who also have social anxiety. In a very small study presented at the APA symposium, researchers examined the effect of two MDMA treatments, spaced a month apart, on 12 adults with autism and social anxiety. The subjects also received talk therapy. The researchers found that the patients experienced significant and long-lasting reductions in their social anxiety symptoms.

"Social anxiety is prevalent in [adults with autism], and few treatment options have been shown to be effective," said Alicia Danforth, of the Los Angeles Biomedical Research Institute at the Harbor-UCLA Medical Center, who presented the study. "The positive effects of using MDMA and therapy lasted months, or even years, for most of the research volunteers."

Still, because the study was small, more research is needed to better understand how MDMA and talk therapy may treat social anxiety in adults with autism.

Psilocybin

Recent studies also suggest that psilocybincould benefit patients who have cancer-related psychological distress, or cancer patients with depression who haven't benefited from other treatments. For example, in 2016, two studies involving a total of 80 patients found that a single dose of psilocybin could considerably reduce the depression and anxiety felt by patients who had terminal or advanced cancer, compared with those who took a placebo. And the effect was long-lasting; up to 80 percent of participants saw their reductions in depression and anxiety last for six months.

In another study discussed at the APA symposium, 13 patients with life-threatening cancer who experienced anxiety and distress were treated with psilocybin combined with talk therapy. Results showed that the patients were better able to grapple with loss and existential distress, and many patients said they developed a new understanding of dying, according to the researchers.

"Participants made spiritual or religious interpretations of their experience, and the psilocybin treatment helped facilitate a reconnection to life [and] greater mindfulness and presence and gave them more confidence when faced with cancer recurrence," said Gabby Agin-Liebes, a doctoral candidate in psychology at Palo Alto University in California, who presented the study.

Ayahuasca

Ayahuasca is a drink made from plants that grow in the Amazon and that indigenous people in South America have traditionally used for spiritual ceremonies. It contains the hallucinogen N,N-dimethyltryptamine, or DMT, as well as compounds that may have anti-depressive effects.

Indeed, preliminary research suggests that the drug may benefit people who have depression. In a small study in Brazil, researchers looked at the effects of ayahuasca in six people with depression who'd never taken the drug before. Within hours of taking ayahuasca, patients saw improvements in their symptoms, which lasted for the three-week study period, according to a 2015 article in the journal Nature. The researchers are now conducting larger studies of the drug.

As for how ayahuasca and other drugs help with psychiatric conditions, there are likely many factors involved. But one study suggests that feelings of spirituality, and how they related to people's ability to regulate their emotions, may play a role.

That study, also presented at the symposium, involved 159 participants who reported that they had taken a hallucinogen at some point in their lives, such as psilocybin, ayahuasca or LSD (lysergic acid diethylamide).

Participants also reported on their levels of spirituality and their relationships with their emotions. The study found that use of hallucinogens was linked with increased levels of spirituality, which in turn was tied to improved emotional stability and fewer symptoms of anxiety and depression.

"This study reinforces the need for the psychological field to consider a larger role for spirituality in the context of mainstream treatment, because spiritual growth and a connection to something greater than the self can be fostered," said Adele Lafrance, an associate professor of psychology at Laurentian University in Ontario, who presented the findings at the symposium.

Original article on Live Science.