The Tibetan Book of the Dead
The Tibetan Book of the Dead, whose actual title is "The Great Liberation upon Hearing in the Intermediate State" or "Bardo Thodol", is traditionally believed to be the work of the legendary Padma Sambhava in the 8th century A.D. The book acts as a guide for the dead during the state that intervenes death and the next rebirth. He is considered to be one of the first persons to bring Buddhism to Tibet. The Bardo Thodol is a guide that is read aloud to the dead while they are in the state between death and reincarnation in order for them to recognize the nature of their mind and attain liberation from the cycle of rebirth.
The Bardo Thodol teaches that once awareness is freed from the body, it creates its own reality as one would experience in a dream. This dream occurs in various phases (bardos) in ways both wonderful and terrifying.
Overwhelming peaceful and wrathful visions and deities appear. Since the deceased's awareness is in confusion of no longer being connected to a physical body, it needs help and guidance in order that enlightenment and liberation occurs. The Bardo Thodol teaches how we can attain Nirvana by recognizing the heavenly realms instead of entering into the lower realms where the cycle of birth and rebirth continue.
On the second day, there appears the second-highest God in the Buddhist pantheon - in fact, he is actually the Second Person in the literal Buddhist Holy Trinity. At the same time, there dawns a smoky light from hell; and here we note that, just as the Buddhist heaven is not a permanent, eternal state, neither is its hell. Even the most wretched souls will eventually work their way out of even the deepest pit of hell, just as even the highest and purest souls will eventually lose their footing in heaven and descend again into the cycle of death and rebirth. Liberation is the only way out.