Why do hallucinations appear in depression? We all know the stories of people who saw a miracle in the deepist troubles like gangsters who turned to faith - or an older example could be the miracles in jail in the Bible (Acts: Peter and Paul).

How wide-spread is the phenomenon where people expierence hallucinations in a depressing situation? What is the neurological cause? And what hormones (neurotrasmitters) participate on this phenomenon?

Please concentrate on the neurological point of view, rather than on the psychological aspects.

Thank you.
Have a look at The God drug DMT. It causes people to see/talk to God and can be taken as an actual drug, but I believe it is also produced in the body during near death experiences. I am no expert in it but here's wikipedia: https://en.m.wikipedia.org/wiki/N,N-Dimethyltryptamine