Okay, I think I understand.
There are a few atmospheric conditions which can cause hallucinations which are unrelated to mental health. CO2 poisoning is a big one, and infrasound, and unshielded electronics (bad wiring, old CRT's) can contribute to visions of phantoms, or shadows. These are often the primary drivers for someone seeing a ghost.
A ghostly encounter, if I understand you correctly, is based on situational perception. This is more psychology than neurochemistry. The best examples come from police officers called into situation where security alarms have been triggered yet the building is secured, and even after the alarm company sends a technician to inspect the system the alarm continues to be tripped. Usually between the third or fourth time being dispatched to the location one or more of the officers becomes jumpy, and sees a shadow in a window. After a search of the location comes up empty the officers go from jumpy to spooked, and from there on the location gets a reputation for being haunted.
Another example is a person hearing someone come into a familiar space such as a home, office, or place of employment only to discover that they are alone, and no one has entered the location. This is a case of the brain putting sounds together to paint a familiar picture in a person's head when the sounds are actually unrelated to a door opening or closing, or footsteps, or whatever other noises are common. This kind of event is what forced me to re-think my belief in ghosts because the most common ghostly experience is that where the ghost is of someone who is still alive. Many people have been at home working on a project or watching TV and heard a family member in another part of the house only to later learn that family member was not there. Most folks rightly blow it off to a brain fart but there have been a few nasty arguments where one is accused of lying.
Part of my job is monitoring security cameras and I've learned that concentration is conditional, and that people move faster than you think they can. I think back on all the stories I was told about a man being seen in a location only to vanish a few seconds later while supposedly in a wide open area where leaving it unseen in a short amount of time was "impossible". I now have the luxury of video playback. Those cases where someone seemed to vanish were actually a case of a guy walking fast and me walking slow. Playback confirms that what I see the first time live on screen isn't always what happened when I review the footage later.
Not sure if this helped or not.