"Is any among you sick? Let him call for the presbyters of the Church, and let them pray over him, anointing him with oil in the name of the Lord; and the prayer of faith will save the sick man, and the Lord will raise him up; and if he has committed sins, he will be forgiven." (James 5:14-15)
The sacrament of Anointing of the Sick has as its purpose the conferral of a special grace on the Christian experiencing the difficulties inherent in the condition of grave illness or old age. It is appropriate for a believer to receive this sacrament when he begins to be in danger of death because of illness or old age. Only a priest or bishop may give the sacrament, using oil blessed by the bishop or, if necessary, by the celebrating priest himself.
The special grace of this sacrament has as its effect: the uniting of the sick person to the passion of Christ; the strengthening, peace and courage to endure the sufferings of illness or old age; the forgiveness of sins, if the sick person was not able to obtain it through the sacrament of Penance; the restoration of health, if it is conducive to the salvation of his soul; the preparation for passing over to eternal life.
(Information from Catechism of the Catholic Church)