In looking at the concept of a ghost, the first problem one encounters is defining exactly what is meant by such an apparition.  It seems that the general view over history is that ghosts represent some aspect of a once living individual that may have occasion to make itself known.  This is generally considered to be a soul, or some animating spirit, so for our purposes that loose definition will do.

I won't consider the problems of why such an entity would be geographically confined, or even what such a thing means.  Instead let's consider what it takes for a ghost to engage in a haunting.

The first thing we have to define is that for a haunting or ghost to be "real", then it must also be subjected to the laws of science as we know them to be.  It doesn't do any good to postulate magical excuses or supernatural capabilities, since that automatically renders it outside science, in which case such existence is merely the product of fantasy and imagination.

More importantly, even if one were to attribute magical powers to ghosts, they cannot be attributed to the victims or observers of those ghosts, since they are subject to the laws of science in making the observation.  

Typically the characteristics attributed to ghosts and hauntings are that of visual apparitions, noises, movement,and interaction with objects (doors, drawers, etc.).  However, that's where the problems begin.

Since Newton's laws require that for every action there is an equal and opposite reaction, then ANY interaction a ghost has with our world requires a substantive existence.  In order to be visible there must be something which is capable of scattering or reflecting light.  To make sounds there must be something capable of generating a pressure wave.  Movement occurs within the context of friction, gravity, and energy.  In short, for a ghost to manifest in any way requires that it consist of a physical existence with which it interacts.

However, if such a physical existence occurred, then it is also subject to the laws of physics from our world.  A ghost capable of opening a door must also be capable of having the door closed on it.  

For a ghost to be considered as capable of moving through solid objects, it effectively is behaving as if the material were transparent (in a fashion similar to light passing through a glass).  However, even such an interaction is subject to the laws of physics, so any material existence would be limited in the objects it could pass through and how such movement could occur.  In effect, like light, not all materials would be transparent.

Similarly when movement is attributed to ghosts, it must occur with respect to something.  This requires energy to initiate and maintain the ordered movement of a collection of atoms, such that an apparition could hold together.  However, such energy always requires a means of generation and storage so the ghost would need even more physical interaction with the world to achieve even this simple act.

We could certainly postulate that a ghost's existence is only sometimes material and other times ethereal, but this poses the problem of how atoms are assembled for the material phase of existence.  They certainly can't come from nothing since matter can be neither created nor destroyed.  Therefore we have to conclude that ghosts either always exist, or they have no physical existence.  

If ghosts always exist, then they are simply physical creatures and can be handled like any other physical creature (i.e. subject to our scientific laws).  If they have no physical existence, then they must be undetectable.

In examining any phenomenon like this, the presumption is that the laws of science will apply and therefore they must apply to everything, including the ghost.  It doesn't do any good to invoke words like "energy" or "electro-magnetic fields" as if they were magical phrases that can be used to explain behaviors.  They represent specific scientific phenomenon that can be examined and measured.

While there are many people that will swear that they have either witnessed such ghosts or encountered them in a variety of circumstances, it seems that the most likely explanation for such an existence is that they are manufactured by the imagination in our own brains.  It is only in our imagination that we can suspend the laws of science and experience something for which no natural explanation can occur.