There is no ghost actually. But in Islam, we have to belief on the existance of angels, spirit, genie, satans, and evil; they are around us, but we can not see them.
Angels live in various races and duties like human, they live only for the God (Allah), only do good thing for all their lives, they never make mistake in their whole live and never sin.
Spirit is the one who live in human's body - their soul. A man without soul is a corpse. If a man die, he will be set back to Allah and live in different world dimension to us, waiting for the judgement day. In the dimension, they can see us, but we can not see them. They can do nothing for us, nor to help, nor to hurt, nor to attack, nor to do something bad. There is such a transparent wall that separate us with them. They can do nothing but wait; wait for the end of time, wait for the pray from the ones who love them.
Satans, evil, and genie basically are the same in body structure. The diffrence is; satans are kinds of genie whose live are only to make sins in all their live and whose duties to attract as many as humans and other genies to follow their ways. Evil is the king of satans, he is the great king of satans who rule all satans from the whole world. And, genies are the ones like men-- they can be good, they can be bad. They can be Islam, Christian, Budhist, HIndist, even Atheist.
If someday, you heard someone tell about ghost that try to impose someone else, it is not human spirit, but they are genie.