The last rites, in Catholicism, are the last prayers and ministrations given to an individual of the faith, when possible, shortly before death. The last rites go by various names. They may be administered to those awaiting execution, mortally injured, or terminally ill.
What in the judgment of the Roman Catholic Church are properly described as the Last Rites are Viaticum (Holy Communion administered to someone who is dying), and the ritual prayers of Commendation of the Dying, and Prayers for the Dead.
Of these, only Viaticum is a sacrament.
The sacrament of Anointing of the Sick has often been postponed until someone is near death, so much so that, in spite of the fact that in all celebrations of this sacrament, the liturgy prays for recovery of the health of the sick person if that would be conducive to his salvation, Anointing of the Sick has been thought to be exclusively for the dying and has been called Extreme Unction (Final Anointing). If administered to someone who is not just ill but near death, Anointing of the Sick is generally accompanied by celebration of the sacraments of Penance and Viaticum. In such cases, the normal order of administration is: first Penance, then Anointing, then Viaticum.
Although these three sacraments are not, in the proper sense, the Last Rites, they are sometimes mistakenly spoken of as such.
The Eucharist given as Viaticum is the only sacrament essentially associated with dying: "The celebration of the Eucharist as Viaticum is the sacrament proper to the dying Christian".
In the Roman Ritual's Pastoral Care of the Sick: Rites of Anointing and Viaticum, Viaticum is the only sacrament dealt with in Part II: Pastoral Care of the Dying. Within that part, the chapter on Viaticum is followed by two more chapters, one on Commendation of the Dying, with short texts, mainly from the Bible, a special form of the litany of the saints, and other prayers, and the other on Prayers for the Dead. A final chapter provides Rites for Exceptional Circumstances, namely, the Continuous Rite of Penance, Anointing, and Viaticum, Rite for Emergencies, and Christian Initiation for the Dying. The last of these concerns the administration of the sacraments of Baptism and Confirmation to those who have not received them.
People awaiting execution would receive Confession and Viaticum, but not Anointing of the Sick, since their impending death is not on account of an illness.
In the Orthodox Church and those Eastern Catholic Churches which follow the Byzantine Rite, the last rites consist of the Sacred Mysteries (sacraments) of Confession and the reception of Holy Communion.
Following these sacraments, when a person dies, there are a series of prayers known as The Office at the Parting of the Soul From the Body. This consists of a blessing by the priest, the usual beginning, and after the Lord's Prayer, Psalm 50. Then a Canon to the Theotokos is chanted, entitled, "On behalf of a man whose soul is departing, and who cannot speak". This is an elongated poem speaking in the person of the one who is dying, asking for forgiveness of sin, the mercy of God, and the intercession of the saints. The rite is concluded by three prayers said by the priest, the last one being said "at the departure of the soul."
There is an alternative rite known as The Office at the Parting of the Soul from the Body When a Man has Suffered for a Long Time. The outline of this rite is the same as above, except that Psalm 70 and Psalm 143 precede Psalm 50, and the words of the canon and the prayers are different.
The rubric in the Book of Needs (priest's service book) states, "With respect to the Services said at the parting of the soul, we note that if time does not permit to read the whole Canon, then customarily just one of the prayers, found at the end of the Canon, is read by the Priest at the moment of the parting of the soul from the body."
In the Orthodox Church Holy Unction is not considered to be solely a part of a person's preparation for death, but is administered to any Orthodox Christian who is ill, physically or spiritually, to ask for God's mercy and forgiveness of sin. There is an abbreviated form of Holy Unction to be performed for a person in imminent danger of death, which does not replace the full rite in other cases.