When I think of them I have compassion for them.
I think I saw a ghost once, but am not sure. I was feverish and sick... But I felt fear then.
I think i just chanted Mahamantra : hare krsna hare krsna krsna krsna hare hare, hare rama hare rama rama rama hare hare,
and narasingha prayers. The ghost disappeared then.
The main reasons a person would become a ghost is from very strange and violent deaths, or from suicide..
Ghosts are sometimes quite scary because they can have mystic siddhis, like brahma rakshashas have.
However most ghosts are scary only because they are miserable suffering souls, and because they are envious of persons with bodies, they try to "haunt" weak minded persons, so that they can again feel the pleasures of the body/senses.
The best thing to do when encountering a ghost is to chant God's names to it, or any kirtan, like Srimad Bhagavatam narration, or to give the ghost prasad.
The saintly one, Gokarna, had much mercy on the ghost of his brother Dundakari. He narrated Srimad Bhagavatam to him for 7 days, and at the end of the seven days Dundakari was completely purified and enlightened, and an ariplane of Vaikuntha came and brought to the Realm of the Lord. Very kind, and sweet.