Psilocybin is metabolized into psilocin in the body, a 5-HT agonist, it binds to the receptors in the brain that would normally be used by the neurotransmitter serotonin. The serotonin system is one of four modulatory networks. Serotonin is responsible for such things as sleep/wake cycle, mood, pain control. It may also cause an increase in dopamine, another important neurotransmitter. Of course this description is grossly over simplified and the exact mechanism of action of hallucinogenic drugs is not very well understood.

For more information:
http://thedea.org/yourbrain.html
http://en.wikipedia.org/wiki/Psilocybin
http://www.biopsychiatry.com/psilocybin.htm