What does the phrase mean We shall not all sleep, but we shall be changed?

Can you please tell me the meaning of the verse in  1 Corinthians 15:51

Is it speaking of spirits?

It says...Behold, I tell you a mystery: We shall not all sleep, but we shall be changed.
 
First we must answer the question - what is a mystery in the Bible?

The word "mystery" in the Bible refers to a newly-revealed teaching that previous generations did not know.  The word "mystery" carries with it the connotation of being creepy or mysterious as in a crime-solving story.  However, the idea of a Bible mystery is that the truth was previously hidden, but not revealed.

There are several of these teachings revealed in the New Testament that were not known in the Old Testament including:
•    The Mystery of the Jew and Gentile sharing equally in God's Plan - Ephesians 3:1-12
•    The mystery that the Holy Spirit would indwell believers permanently - 1 Corinthians 2:6-16
•    The mystery that the Church would be raptured out of the world at the end of the age of the Church - 1 Corinthians 15:51-58, 1 Thessalonians 4:13-18
•    The mystery of the will of God - Ephesians 1:9
•    The mystery that God would come and live among us in the form of a man - 1 Timothy 3:16

The mystery of 1 Corinthians 15:51 refers to the moment of the rapture.  All who believe in Christ will not remain in the grave.  Believers in the Old Testament knew that they were awaiting eternal life for them, but the details of the nature of the resurrection were unclear until the New Testament was completed.

The chapter refers to spirits (or the souls) and bodies of believers who have died.  The body appears to be asleep while dead.  The Scriptures refer to the dead in Christ as sleeping.  Those who die in their sins are "dead".  However, the spiritual part of the person is "with Christ which is far better" (Philippians 1:23) until the moment of the rapture.  Christ will return to the earth, resurrect those who have died in Christ and take living believers directly to heaven.   

Shad Sluiter