According to traditional Japanese beliefs, all humans have a spirit or soul called a reikon ( 霊魂 ). When a person dies, the reikon leaves the body and enters a form of purgatory, where it waits for the proper funeral and post-funeral rites to be performed, so that it may join its ancestors. If this is done correctly, the reikon is believed to be a protector of the living family and to return yearly in August during the Obon Festival to receive thanks.
However, if the person dies in a sudden or violent manner such as murder or suicide, if the proper rites have not been performed, or if they are influenced by powerful emotions such as a desire for revenge, love, jealousy, hatred or sorrow, the reikon is thought to transform into a yurei, which can then bridge the gap back to the physical world.
The yurei then exists on Earth until it can be laid to rest, either by performing the missing rituals, or resolving the emotional conflict that still ties it to the physical plane. If the rituals are not completed or the conflict left unresolved, the yurei will persist in its haunting.
In the late 17th century, a game called Hyakumonogatari Kaidankai became popular, and kaidan increasingly became a subject for theater, literature and other arts. At this time, they began to gain certain attributes to distinguish themselves from living humans, making it easier to spot yurei characters.
Ukiyo-e artist Maruyama Okyo created the first known example of the now-traditional yurei, in his painting The Ghost of Oyuki.
Today, the appearance of yurei is somewhat uniform, instantly signalling the ghostly nature of the figure, and assuring that it is culturally authentic.
While all Japanese ghosts are called yurei, within that category there are several specific types of phantom, classified mainly by the manner they died or their reason for returning to Earth.
There are two types of ghosts specific to Buddhism, both being examples of unfullfilled earthly hungers being carried on after death. They are different from other classifications of yurei due to their wholly religious nature.
In Japanese folklore, not only the dead are able to manifest their reikon for a haunting. Living creatures possessed by extraordinary jealousy or rage can release their spirit as an ikiryo ???, a living ghost that can enact its will while still alive.
The most famous example of an ikiryo is Rokujo no Miyasundokoro, from the novel The Tale of Genji.
Yurei often fall under the general umbrella term of obake, derived from the verb bakeru, meaning "to change"; thus obake are preternatural beings who have undergone some sort of change, from the natural realm to the supernatural.
However, Kunio Yanagita, one of Japan's earliest and foremost folklorists, made a clear distinction between yurei and obake in his seminal "Yokaidangi (Lectures on Monsters)." He claimed that yurei haunt a particular person, while obake haunt a particular place.
When looking at typical kaidan, this does not appear to be true. Yurei such as Okiku haunt a particular place -in Okiku's case, the well where she died-, and continue to do so long after the person who killed them has died.
Yurei do not wander at random, but generally stay near a specific location, such as where they were killed or where their body lies, or follow a specific person, such as their murderer, or a beloved. They usually appear between 2 and 3 a.m, the witching hour for Japan, when the veils between the world of the dead and the world of the living are at their thinnest.
Yurei will continue to haunt that particular person or place until their purpose is fulfilled, and they can move on to the afterlife. However, some particularly strong yurei, specifically onryo who are consumed by vengeance, continue to haunt long after their killers have been brought to justice.
 Famous Hauntings
Some famous locations that are said to be haunted by yurei are the well of Himeji Castle, haunted by the ghost of Okiku, and Aokigahara, the forest at the bottom of Mt. Fuji, which is a popular location for suicide. A particularly powerful onryo, Oiwa, is said to be able to bring vengeance on any actress portraying her part in a theater or film adaptation.
The easiest way to exorcise a yurei is to help it fulfill its purpose. When the reason for the strong emotion binding the spirit to Earth is gone, the yurei is satisfied and can move on. Traditionally, this is accomplished by family members enacting revenge upon the yurei's slayer, or when the ghost consummates its passion/love with its intended lover, or when its remains are discovered and given a proper burial with all rites performed.
The emotions of the onryo are particularly strong, and they are the least likely to be pacified by these methods.
On occasion, Buddhist priests and mountain ascetics were hired to perform services on those whose unusual or unfortunate deaths could result in their transition into a vengeful ghost, a practice similar to exorcism. Sometimes these ghosts would be deified in order to placate their spirits.
Like many monsters of Japanese folklore, malicious yurei are repelled by ofuda (???), holy Shinto writings containing the name of a kami. The ofuda must generally be placed on the yurei's forehead to banish the spirit, although they can be attached to a house's entry ways to prevent the yurei from entering.
Ghosts around the world