While the title of "magic mushroom" has been given to many different species of mushroom (See: Mario), today we are only going to focus on those of the genus psilocybe, and eschew those such as Fly Amanita in which the active compound is Muscimol.
The most common way of using psilocybin is through the consumption of psilocybin mushrooms, however, extracted psilocybin (in pill form) has been used in lab experiments as a means of controlling dosage. Almost immediately after being eaten, the body's enzymes begin to metabolize Psilocybin into Psilocin by removing the molecule's phosphate group, thus rendering it structurally similar to serotonin.
Today the role of Psilocin will be played by munchkin cats, and serotonin will be represented again by welsh corgis.
This physical similarity allows the Psilocin to bind with serotonin receptors, thus exciting the nerves and causing the brain to activate as if a flood of real serotonin has been released.
With the addition of psilocin in the brain, the postsynaptic cell is able to fire without the presence of any actual serotonin on the receptors themselves.
Because serotonin receptors are present throughout the brain, the effects of psilocin are extremely variable. The molecule is capable of reaching all parts of the brain, but small amounts begin interacting immediately upon absorption through the tissue of the mouth and stomach. The brain's neural pathways begin to fire in ways in which they normally would not, as they have been excited independently of each other and without a natural (external) stimulus.
This can lead to hallucinations, nausea and vomiting (but only if you ingest mushrooms, straight psilocin doesn't have this effect), temporary synesthesia, twitchiness, dysphoria, euphoria, and an increased likelihood of being suggestible. Bad trips are said to correlate with people who are already emotionally distressed before ingestion. This seems to indicate that use of the drug amplifies the user's pre-existing emotions and thoughts, similar to the effects reported by many people taking SSRIs.
As for long term effects, let's ask the scientists at John Hopkins University.
In 2006 a team of researchers from the university's School of Medicine set out to investigate the "acute and persisting effects" of psilocybin use. The results of the study were then published in the Journal of Psychopharmacology. According to the researchers, when psilocybin was administered to "hallucinogen-naive adults" who were self-reported to have "regular participation in religious or spiritual activities":
Psilocybin produced a range of acute perceptual changes, subjective experiences, and labile moods including anxiety. Psilocybin also increased measures of mystical experience. At 2 months, the volunteers rated the psilocybin experience as having substantial personal meaning and spiritual significance and attributed to the experience sustained positive changes in attitudes and behavior consistent with changes rated by community observers. -Griffiths et. al.Additional details included in the university's original press release report that more than 3/5 of subjects experienced a "Full mystical experience". Two months later 79% of participants who had been given psilocybin reported increased "life satisfaction" when compared to the control group. This same study has appeared in the news, when the team released the results of their two year follow-up. The numbers are still high, with 58% stating the experiences as being one of the "five most personally meaningful" experiences of their lives and 64% reporting increased life satisfaction.
That's right. Tripping balls, despite what they told you, really has been documented, at least once, to have made some people's lives better.