I'm skeptical about ghosts, but I do get scared whenever I'm walking and all the lights turn off.
But there is an explanation for this tho. Its the Fight or Flight response of the body,
let me explain,
The prefrontal cortex of the brain is responsible for the interpretation of sensory information. There have been some signs that point to this area being responsible for a person learning fear responses. Presumably, all fear is based on sensory information gathered through experience. This would imply that, once a certain stimuli has been interpreted as an unwanted sensation, it causes the person to both subconsciously and actively avoid those sensations. While this does explain why people will avoid being caught in certain situations after having experienced them once before, this does not always equate to a person being afraid of said situation.
Fear and concepts of ghosts' etc could therefore be effects of overactivity of hormones and enzymes within the pre-fontal cortex that is effervesced during the fight or flight complex; the autonomous nervous system in full drive.
Linkback:
https://tubagbohol.mikeligalig.com/index.php?topic=6829.0