All beings are composed of three elements. These are the Physical Body (Deha), the Conscious Mind (called Mana), Soul (the spirit, i.e. the Universal soul or part of God Almighty). Birth or life would imply the coming together of these three factors of Body, Mind and Soul while perfect death will imply the separation of these three elements. Physical or Medical death will imply the separation of the two elements of Mind and Soul from the Body. Similarly, Coma (Mental death) and such physical conditions where the death of the conscious Mind are seen, yet the person is medically alive occurs when the Body and Soul are separated from the Mind. Thus, three types of death occur where all three of Body, Mind and Soul are separated or either of Body or Mind is separated from the other two. However, there is another type of death where the Body and Mind exist, but the Soul is temporarily or permanently replaced by another. This is Possession and has been recorded by various saints and shown in movies like the Exorcist.
Normally, medical death occurs when the Body is separated from the Mind and the Soul. The Soul, which is conscious of its existence, continues to exist and to do such things, as it desires to do. This existence is in various astral planes, which for simplicity can be called the planes of consciousness. Having established that the conscious Soul exists with the Body and Mind from birth till physical death and that it exists with the Mind for some time after medical death, what happens thereafter has been the vexed question for which we have to fall back on the various philosophies and sacred literature. The question of life after death has been the seed for the birth of all religions. Simple philosophies ascribe a simple good and bad or black and white theory where the good souls go to God and the evil souls rot in hell. The definition of God has been limited by the human mind that fails to conceive of the end of the universe and consequently, fails to define God. Because of this natural limitation, every at-tempt to define God is bound to fail. This is well exemplified in the Upanishads where the nature of Brahman (God) has been debated.