Buddhism does teach the existence of ghosts through story and imagery, most specifically through what are called, "hungry ghosts." Hungry Ghosts are used as a metaphor demonstrating that ghosts do suffer through attempting to fulfill earthly desires. It is an exercise in futility, because ghosts find themselves without physical bodies to be able to act out such lusts. The seventh month is believed by many followers of Buddhism to be a time when ghosts and spirits come out of the lower realm and interact with people. So a Ghost Festival of sorts is honored, paying homage to ancestors through various rituals designed to ease the suffering of ghosts and possibly aid in direction. It is believed by Buddhists who celebrate the festival that their ancestors visit them, so it is a time to prepare elaborate meals, ceremonies and offerings to help them in their journey in the afterlife.
In Buddhism, hungry ghosts are simply suffering spirits who should be treated with compassion and not feared. Some Buddhists believe ghosts should be led to the light through chanting and explanation of Buddhist teachings, until the golden light of Buddha is seen and can be advanced to by the ghost.
The same Buddhists also teach that ghosts can remain around people through their concern and love for them. It is also thought that some ghosts are lost due to not understanding their own death and the existence of the afterlife. Other ghosts are believed to remain earthbound due to self-created fear, guilt and shame - all forms of self-condemnation which need to be worked through. Ghosts may not have a concept of time and remain stuck in the year of their own passing, an illusion created by their mind. Some Buddhists also teach ghost possession can occur when ghosts who suffer from earthly lusts and addictions seek to fulfill those desires or "highs" through another's physical body.
Buddhism and Hinduism have influenced each other, though they have fundamental differences. Buddhism does find its roots within Hinduism, as Buddha was born into a Hindu family, but later found enlightenment which spawned new, radical teachings upon which Buddhism was founded. Ergo, teachings concerning ghosts in Hinduism can also be found.