Dreams or visions of ghosts or spirit tells you about qualities you fear, you can also see it as the qualities you lack. Maybe it is a painful memory or guilt, emotions, fear, anger or repressed feelings. Another meaning is that there is something that is no longer attainable, something that is a from of the past but that you cannot let go. Yet another explanation is that you do not feel connected to life or society.
You can have an experience where you feel disconnected from your body, your inner self, your source, your base, soul because you are out of balance. Another explanation is that you should become aware of what is reality and what is fantasy. Another important explanation is that you may become aware that an old way of doing things no longer applies and must change in order to move forward in life.
Another alternative explanation is that you receive a message from a loved one from the afterlife. Another alternative explanation is that you could be afraid of death, and the fear of the new unknown death and rebirth.
As an additional alternative, a ghost or spirit can also refer to spiritual awakening, growth and development of your third sense. Mediumship or something connected with that which is not visible to the third eye.