The last rites have not been eliminated. What many Catholics do not understand, though, is that the "last rites" encompass several Sacraments, including Penance (confession of sins), Viaticum (Holy Communion given as food for the journey to eternal life) and the Anointing of the Sick. Ideally, those Sacraments should be administered when the recipient is aware and able to benefit most.
Like all the Sacraments, anointing is given only to the living. The word "Sacrament" means "sign," a sign of Christ's presence, but after death, the person is already meeting Christ face to face.
As Canon No. 1005 in the Code of Canon Law indicates, though, the Sacrament of Anointing may still be administered if there is doubt as to whether death has occurred.
If the person has already died, the priest instead chooses from the prayers for the deceased in his ritual book (Pastoral Care of the Sick).
One especially beautiful prayer is this: "Loving and merciful God, we entrust our brother/sister to your mercy. You loved him/her greatly in this life; now that he/she is freed from all its cares, give him/her happiness and peace forever. Welcome him/her now into paradise, where there will be no more sorrow, no more weeping or pain, but only peace and joy with Jesus, your son."
What is particularly troublesome to parish priests is that families often wait until the last minute before calling a priest. This is due, in part, to the fact that the sacrament of anointing of the sick used to be called "extreme unction." But the clear teaching of the church is that someone does not have to be in extremis (i.e., in imminent danger of dying.)
Canon No. 1004 provides that "the anointing of the sick can be administered to a member of the faithful who, having reached the use of reason, begins to be in danger due to sickness or old age." The ritual itself designates as proper recipients, "a sick person before surgery, whenever the surgery is necessitated by a dangerous illness," as well as "elderly people if they are weak, though not dangerously ill."
What many forget is that the first purpose of anointing is to bring about healing, physically and spiritually. In his epistle, St. James (Jas 5:14-15) says: "Is anyone among you sick? He should summon the presbyters of the church, and they should pray over him and anoint him with oil in the name of the Lord, and the prayer of faith will save the sick person."
If, instead, it be the will of God that the person will soon die, the prayer of anointing asks that the person be relieved of suffering and feel the power and peace of God. The Sacrament should be administered when it can do the most good, so the rule of thumb is: Call the priest sooner rather than later.