What happens after we die?
According to Islamic tradition, it all depends on what kind of life you've led. If you've been a good, virtuous Muslim, your spirit is taken to Heaven and celebrated. If you've behaved badly, the spirit is scorned. Then the spirit is apparently returned to the body for the definite judgment. The inquisitors in the grave are two angels called Munkar and Nakir.
In Islam, the angels (malak) are links between God and humanity. They are unseen to normal people, but make their presence felt around the moment of death. The first angel one is likely to meet is Azra'il, the angel of death. He takes the soul away as we die. In many descriptions, Azra'il is accompanied by a host of other angels who are either very happy or very sad, depending on one's behaviour in life.
The crucial test is yet to come
The meeting with Munkar and Nakir is the greatest trial after a Muslim's death, and is why at the moment of death those who are close to him take care to make the Muslim declaration of faith be the last thing he hears. The souls of dead people are vulnerable to Satan's evil ways, and if he manages to make them forget their faith, it means victory for him and torment for them.
All the mourners can do is put the corpse in the ground, turned towards Mecca, and hope for the best. As soon as the mourners have left the grave, they may be just fourty paces away, the dark angels of death arrive. They are terrible to behold, described as having "twelve eyes that glitter like lightening, voices as loud as thunder, teeth as canine as the horns of a cow, hair that drags to their feet", and "shoulders as broad as a distance of a journey of several days".
Nakir and Munkar return the soul to the body and the body to life.
Then they ask the crucial questions:
Who is your Lord?
Who is your Prophet?
What is your Religion?
In addition to this, they may question the deceased about his good and evil deeds in life, as well as other aspects of Islam - matters regarding Muslim practice, like fasting, Hajj, Qiblah, Salaat and Zakaat, or subjects of doctrine and heresy - the Quran, which Imams he listened to, etc.
If the responses are satisfactory, the angels become friendly and fair. They rejoice and together with another couple of angels, Bashir and Mubashir, they congratulate the deceased believer. His soul is then gently taken from his lips and borne to Paradise.
I'm sorry to say that the punishment is very severe for the one who fails to answer the questions correctly. The infidel is beaten about the head with clubs of iron, then his soul is painfully wrenched from his body, only to be sent to Hell and infinite torment.
Although the two inquisitor angels have been vividly imagined and earnestly discussed by many learned scholar, there is some doubt as to whether they are actually part of Islam as described by its prophet. The Quran does state that people will be tried and judged in their graves (suras 8.52 and 47.29). It does not mention Nakir and Munkar by name, however. The Hadith, which holds almost equal weight among many Muslims, does mention them on several occasions. Many common people and some orthodox theologists (Ash'ari) firmly believe in the visitation of Munkar and Nakir.
A similar custom of letting the declaration of faith be the last words a person hears is also found in Judaism. A dying Jew is supposed to utter the Shema, or if he is too weak, he who is nearest and dearest to him must say it within his hearing. In Jewish belief, Satan is both the angel of death and the prosecutor in the afterlife. The Muslim angels Nakir and Munkar seem to be a further development of this all-purpose angel.
Although Christianity does not have any particular set of dying words that people are required to hear or recite, it is common among Catholics to make a deathbed confession so that they will be sin-free when they enter the afterlife. There is also a similar belief in punishment in the purgatory, but no questioning angels.
As for the dead Muslim, he might meet an abundance of angels in addition to the previously mentioned ones. Another angel who might visit the grave is Ruman, who presents more trials for the deceased. After the formalities are over they will either meet Ridwan, guardian angel of Paradise, or Malik, master of Hell.
I apologise if I've made a mistake anywhere in this node. I'm neither Muslim, Jew nor Catholic, and it's very easy to get other people's religions wrong.