The realm of the petas, the Hungry Ghosts, constitutes one of the unhappy worlds. The ghosts are beings who suffer severely from unfulfilled desires. Traditionally they are drawn with bloated bellies and tiny mouths to signify the size of their appetites and the poor means they have of satisfying them.
One way of thinking of ghosts is that they represent an incomplete death process. When a being dies with great craving and attachment to the objects and places of his previous life, the force of his clinging may make him linger as a ghost. He is unable to continue his earthly life but he grasps at a painful shadow.
Many people all over the world and in all cultures have seen ghosts, because this realm is so close to the human. Some individuals with psychic powers can see ghosts easily and some of these have reported that our big modern cities are full of ghosts. This is because our coarse materialist culture breeds the grasping mind which cannot let go at death. A curious thing, that as people succumb to materialism, they are less likely to believe in or see a ghost, but far more likely to become one!
The proper attitude towards ghosts is one of compassion. We should endeavour to help them move on and seek a better rebirth. We can do this by extending them loving-kindness if we detect their presence. It is also skilful to transfer merit to those in the ghost realm, particulary our departed relatives. This is done by performing some meritorious deed and dedicating the merit to the departed. It is said that those in a ghostly form are aware of this and rejoice, and rejoicing in the wholesome is a karmically beneficial mind-state that can lessen their suffering or even facilitate their rebirth into a better realm.
In the scriptures there is one whole volume of ghost stories; this is the Petavatthu, translated as "The Tales of the Departed."
For transference of merit - the original text is the Tirokudda Kanda (Hungry Shades Outside the Wall) of the Khuddakapatha.