A popularly asked question is if the Bible says anything about ghosts. Ghost stories are a part of our culture, and many people claim to have seen a ghost. Sometimes people will go to Mediums to try to talk to the ghost of their dead loved ones. So are ghosts real? Here we'll examine what the Bible says about ghosts.
The Afterlife According To the Bible
Everyone knows that the Bible mentions two specific places in the afterlife: Heaven, and Hell. There is no "intermediate" existence ever described in the Bible. Christians believe that as soon as someone dies, their soul will immediately go to one of these two places: "We die only once, and then we are judged." (Hebrews 9:27). So judgment proceeds immediately after death, and the soul is sent to either Heaven or Hell. The intermediate location Purgatory is not a Biblical concept.
Jesus once told a story about two men who died in Luke 16:19-31. Here, the rich man and the poor man both die, and right away the poor man goes to Heaven and the rich man goes to Hell. Even though the rich man was concerned about his family, he was stuck in Hell and couldn't go visit them (Luke 16:27-28). When Jesus was dying on the cross, he promised the thief dying next to him that "Today, you will be with me in paradise."(Luke 23:43). Christians are promised that as soon as we die, we will be in Heaven with Jesus (2 Corinthians 5:6-9, Philippians 1:23). There is no time after death that we can wander the Earth or go visit relatives or talk to Mediums, because the soul instantly goes to Heaven or Hell.
Near death experiences have confirmed that people do not stay as ghosts. While people may temporarily have an out-of-body experience for a few minutes while they are nearly dead, often their experience will progress to a vision of a tunnel, and the tunnel ends in either a bright warm loving light or else it turns into a tunnel of fire. The people who see the warm bright light end up in a happy, peaceful place where they sometimes see their relatives or friends who have passed on before. Those who see the tunnel of fire usually end up in a desolate, dark, hot, and fiery place, where they feel sadness and fear . Source  is a very good source for more information about near-death experiences and what some people saw in either Heaven or Hell.
The "Ghost" of Samuel
There is only one story in the Bible that might give support to the idea of "ghosts". In the book of 1 Samuel chapter 28, King Saul is afraid of an attack by the Philistines, and needs to know what to do. He decides to go to a woman who can talk with the spirits of dead people, and asked her to talk to the spirit of Samuel (a prophet of Israel). The woman obeys, and sees a spirit coming out of the ground which looks like an old man wearing a robe. She screams. The ghost of Samuel asks "Why are you bothering me by bringing me up like this?" Saul tries to explain he is scared of the Philistines and doesn't know what to do. Samuel says that God is angry at Saul, and that Israel will be defeated and Saul and his sons will all die.
In this story, it appears that Samuel was indeed a ghost. However, I believe this was a one-time exception that God allowed in order to let Samuel communicate God's message to Saul. Clearly, it was not normal for the woman who talked to the dead to see a ghost actually appear - that's why she screamed! Even though she was famous for being able to speak to the dead (1 Samuel 28:7), it seems she was still terrified of seeing a real "ghost"! So probably, when she previously was talking to what she thought were the spirits of dead people, she was probably talking to something else - probably demons, which I will discuss below.
"Ghosts" are really Demons
I believe the most likely explanation for "ghosts" is that people are seeing a demon impersonate a dead person and pretend to be a ghost. Satan can appear to be an angel of light if it suits his purposes (2 Corinthians 11:14) and Satan is the master of lies (John 8:44), so it is likely that other demons (fallen angels) also can impersonate dead people and appear as "ghosts".
So how can demons impersonate dead people? Some people who are sensitive to the supernatural claim that we are surrounded by angels and demons every day - we just can't see them. Demons are probably paying close attention to many people's lives, trying to trick people and tempt them to sin, so of course demons would know basic information about a person's life. I have seen some Mediums on TV talk shows. Often they will ask for an audience member who wants to contact a dead relative or friend. The Medium will be able to give a few basic details about the dead person, such as their name, what they liked, or things they said. The audience member will often become very emotional and excited from just these small pieces of information, which really are nothing new. Then when the audience member asks what happened to their dead relative in the afterlife, the Medium will often just say "Oh, they're fine, just fine. Now, let's move on to the next person...". Demons could easily be giving the information about the dead person to the Medium, and then the Medium quickly moves on to avoid saying the truth about the dead person being in either Heaven or Hell.
Why would demons spend time appearing as ghosts and impersonating dead people? I believe it's the same reason why demons may try to appear as aliens - to convince people Christianity is false. If demons can convince people that what the Bible teaches about the afterlife is false, then it makes Christianity appear false. If everyone goes to "a better place" and is "fine" as the Mediums say, then there's no need to spend your life following Jesus to get into Heaven. This is what the demons want to convince people of, because it keeps people from taking the Bible seriously, and then they will never turn to Jesus and become Christians. Many people who are interested in ghosts can be attracted to get more involved with the occult, such as Ouija boards, pendulums, or trying to contact spirits in other ways. This just draws them into further interactions with demons, and can have serious negative effects on their lives.
What about Haunted Houses?
Another popular idea about ghosts is that they like to haunt certain locations. Sometimes TV shows will send people to one of these locations on a "ghost hunt" to try to find out if it really is haunted or not. They will bring in cameras, infrared sensors, and electronic measuring devices to detect anything unusual. I believe that again, this "haunting" activity is demonic. Exorcists call haunting "demonic infestation", and say it can come with a large variety of phenomena, such as: unexplained sounds or noises, loud bangs, laughter, screams, the temperature of a room dropping or a cold wind with no source, objects disappearing and reappearing in a different location, the feeling of a strange presence, strange odors, effects on electronic equipment, pictures that mysteriously fall down, doors and windows that open/close on their own, and objects that levitate or move mysteriously [2, p.47]. Exorcists say this demonic activity can be caused by a cursed object located on the premises, the location being used for occult activity such as seances, or the location being used for criminal activity such as prostitution, drug dealing, murder, or suicide [2, p.48].
For the ghost hunting TV shows, I'm sure demons would love to put on a show for these programs, because again it shows that ghosts might exist and convinces people Christianity is not true. Demons can certainly affect the electronic measuring devices used to detect "ghosts". One worship leader I know mentioned that sometimes at large Christian worship conferences they would have all sorts of problems with their electronics. Microphones, cables, speakers, and amplifiers would sometimes just stop working, even though they worked fine during sound-check. He believed it was due to spiritual warfare from demons trying to disrupt the service, where hundreds or thousands of people would be praising God.
How to Exorcise A Haunted House
Before you take any of the above evidence as being proof that your house or location is infested with a demon, you should consider more "normal" causes. Is your house drafty? Get an HVAC specialist to come check your heating system and windows for leaks. Is there a sudden bad smell? Make sure it's not a leak in your gas furnace or leaking chemicals. Some people claim they feel a "presence" in a certain location, and have found it was due to faulty electrical wiring which was causing an abnormal electromagnetic field, and the feeling went away after hiring an electrician to rewire the room in question. At Coventry University, a researcher thought he saw a ghost while working late at night in his laboratory. He discovered that there were low frequency vibrations (called infrasound) in his lab, which were due to a standing wave generated by a fan . Other people have reported that infrasound makes them feel "anxiety, uneasiness, extreme sorrow, nervous feelings of revulsion or fear, chills down the spine and feelings of pressure on the chest" . So turn off any large mechanical equipment or anything else that might be causing vibrations and see if the feeling goes away.
After eliminating regular causes, then check if anyone in your home has done any occult or criminal activity. One woman claimed her house was cursed, and discovered her ex-husband had put a satanic painting in a wall of the home, to dedicate the home to an evil spirit. The woman removed the painting and burned it, and the curse disappeared [2, p.61]. Even something as simple as playing with an Ouija board or trying to cast spells could cause demonic activity to start to appear in a home, and throwing away or burning the Occult materials might be a good thing to do (don't donate them, or someone else might get into the same trouble). However, Father Gary believes that the problem is less about the Occultic materials, and more about the spiritual state of the person who used them - turning to the Occult shows a lack of faith in God, an openness to demonic spirits, and a desire to obtain knowledge or power in other unholy ways [2, p.64].
Exorcists say that demoniacally infested locations might be less about the location and more about a person who is being attacked or harassed by a demon [2, p.48], and the demon is trying to scare and intimidate the person in their home. Catholic exorcists typically do a simple blessing and mass in the haunted location to remove any demonic activity [2, p.48], but a person who has more troubles with demons or feels they are possessed will need to seek more help, which often takes years of sessions with an exorcist to make the demon finally leave the person alone . Source  is very interesting for more stories of demonic possession and how the exorcists deal with it.
I do believe that demons really exist, and people need to be careful with what they get involved with or bring into their homes. I have heard some people will move into a home and decide to bless it by saying prayers in each room, or sprinkling some holy water. I don't think these rituals are necessary, even though they are not harmful. Instead, if you are a Christian, simply pray to God and ask for protection in your home, and ask God to remove any unholy presences or influences in the name of Jesus (the name of Jesus is key, as per Luke 9:49), and have faith that God will do it. Play some worship music and have a good time of genuine worship and praise God, since demons hate hearing people worship God. Genuinely give up any interest in the occult and focus your life on loving God, and have faith that God will protect you, and you'll be ok. Christians should not be afraid of demons, for we can command them to leave in the name of Jesus, and God's Holy Spirit who lives in Christians is greater and more powerful than Satan or demons (1 John 4:4). The trick is, you must be a genuine Christian: in the book of Acts, some non-Christians were trying to force out demons, and they couldn't do it and got beaten up (Acts 19:11-16). It's not about us or our power, but the power of God, and so don't get cocky or overconfident in yourself, but we can be confident in God that He will help us if we pray and have real faith in Him.
The Bible never says anything about ghosts in the afterlife - when people die they are judged by God and sent directly to Heaven or Hell. They can't leave unless God allows it, as perhaps in the one exceptional case of Samuel who appeared as a ghost to warn king Saul of his impending doom. In every other case, I believe it is demons who are impersonating dead people and appearing as ghosts to try to convince people that Christianity is false and that everyone goes to a better place when they die. Demons might also use the fascination with ghosts to draw people into Occult activities, which are very dangerous. Demons also seem to be a cause behind haunted houses or other locations. Demons are very good liars, and so don't believe anything they might say to you or a Medium - the only truth we need is what's in the Bible, and the Bible gives us all the details we need to know about the afterlife.
 Maurice S. Rawlings "To Hell and Back: Life After Death Startling New Evidence", 1996
 Matt Baglio "The Rite: The Making of a Modern Exorcist", 2010
 Wikipedia.org - Infrasound