one goes through different sleep stages, rem and deep sleep being two different ones. rem is close to waking state as opposed to deep sleep stages which is marked with significant decrease is brain activity
http://www.sleepdisorderchannel.net/stages/