Spectrophilia refers to the fetish of fantasizing about sex with ghosts or spirits as well as the phenomenon in which people believe they've had a sexual encounter with a ghost. It is also sometimes defined as sexual attraction to looking at oneself or others in a mirror.
The only known academic reference to spectrophilia is from "Forensic and Medico-Legal Aspects of Sexual Crimes and Unusual Sexual Practices" by Dr. Anil Aggrawal. Therein, it is defined as arousal at looking at oneself in the mirror, coitus with spirits or sexual attraction to ghosts.
Accounts of spectrophilia have occurred throughout history. Science has attributed them to a phenomenon called sleep paralysis, something about 20% of people report experiencing. People who have experienced a "sleep demon" describe it as a sense that a spirit is on top of them - or having sex with them. It is theorized to occur when a person experiences a sleep-related hallucination between the lighter and deeper (REM) stage of sleep. Because the person is between stages of sleep, their body remains paralyzed (as in REM sleep) but they maintain the sense that they are conscious and awake.