Reikon, in Shinto, is the equivalent to the soul or 'spirit' in western culture.
When a person dies, the reikon leaves the body and joins the souls of its ancestors, provided the correct funeral and post-funeral rites have been performed.
However, when a person dies in an unexpected manner or with an excess of emotion, or when he or she hasn't been given an appropriate funeral, the Reikon may become a Yūrei, a tormented ghost who remains among the living in order to seek revenge or take care of unfinished business.