The best solution is to try and somehow figure out what the ghost wants. Ghosts are usually stuck because they feel they haven't accomplished something the must do.
Most ghosts are not bad. If you ignore them they will ignore you. But if you really want it to leave you need to speak to it and help him/her cross over to the land of the dead.