1. Prayers For the Dead
In Roman Catholicism, there is a belief in Purgatory. Although Roman Catholics give varying explanations, a popular perception is that purgatory is a place where, through a period of suffering, the soul is purged of sin (it's worth noting that some Roman Catholics today deny that Purgatory is either an actual place or that it has actual time, but we'll leave that for another discussion).
Those within Purgatory want to be purged of their sins (in Roman Catholic theology) but they also want to get out of there and on to heaven. So people are encouraged to pray for the souls of the deceased, for relief/escape from Purgatory. After all, apparently, this suffering can be alleviated through the granting of an indulgence to the person in purgatory.
The Bible, however, teaches that the souls of believers are, at their death made perfect in holiness and do immediately pass into glory. (See Thomas Watson's discussion, for a more detailed discussion.) Given this, prayers for dead believers are useless, since believers are already in heaven.
Furthermore, while certain folks have (from time to time) suggested that salvation is still possible in hell, it is not. Of course, this itself is not normally disputed by Roman Catholics, who recognize that there is no escape from hell itself. Thus, prayers for dead unbelievers are also useless, since unbelievers are already in hell, from which they cannot escape.
Thus, there is no third category - no third option that exists, where prayers for the deceased would have any value. Accordingly, we reject prayers for the dead as vain and superstitious, and we do not engage in such prayers.
2. Prayers To the Dead
In Roman Catholicism there are, from time to time, prayers to the dead. I would be quick to point out Mary, but this doctrine they have of the Assumption of Mary leaves it unclear whether they really consider Mary to be dead or resurrected (although, of course, as a matter of objective fact, she is dead and awaits the resurrection of the faithful). Aside from Mary, however, other saints are sometimes prayed to within Catholicism. One particularly popular saint in English-speaking countries is St. Jude (aka Judas not Iscariot, one of the twelve apostles), the patron saint of lost causes.
We, Reformed Christians, reject such prayers for several reasons. First, there is no reason at all to think that such prayers will be heard and understood by the dead. Second, not only does Scripture not encourage attempted communication with the dead, it condemns such attempts as witchcraft and necromancy. Third, the use of such prayers suggests a lack of faith in the efficacy of prayers directly to the Father. Fourth, the use of such prayers suggests a desire for the mediation of someone other than Christ, an issue that flows over into the next section, below.
This is one of those areas where Roman Catholic apologists are very eager these days to recast the issue in terms like "we're just asking our fellow believers to pray for us, are you saying that's wrong?" The answer to that question is that we do not object to asking fellow believers to pray for us. In fact, we ought to do so. James 5:16 Confess [your] faults one to another, and pray one for another, that ye may be healed. The effectual fervent prayer of a righteous man availeth much.
However, while many of the prayers to the dead are explicitly prayers that the dead would hear the person and pray to God for the person, that simply avoids the most grotesque abuses of the practice, such as when things are requested specifically from the saints or Mary, which are not theirs to give (such as success, grace, salvation, etc.). Those prayers (meta-prayers that request prayer by the saint to whom the prayers are offered) suffer from the objections as to the lack of warrant or example from the Scriptures as well as from the apparent view that these saints are to serve as mediators rather than Christ. As this is not a direct answer to the Romanist objections, I won't go on at greater length here.
3. Prayers Through the Dead
Roman Catholics sometimes explicitly, sometimes implicitly, offer up prayers that are through the dead. For example, the "Approved Prayer for the intercession of Pope John Paul II" (link) is a prayer that is not for John Paul II (JP2) or to JP2 but it is through JP2. It is addressed to God, "O Holy Trinity," but it requests that something be granted "Grant us," via the intercession of JP2 "through his intercession ... ."
Other times the request is more indirect. For example, sometimes when Mary (or others) are entreated it is suggested (as a justification) that since "the prayer of a righteous man availeth much" that the more righteous a person is, the more their prayer will avail (although, of course, the Scriptures do not teach such any such formula). Consequently, the idea is that we are asking these creatures to intercede before God on the basis of the merits that are theirs.
The connection between the two can be seen in this prayer to God pleading the merit and intercession of Rita of Cascia:
O God! who didst deign to confer on St. Rita for imitating Thee in love of her enemies, the favor of bearing her heart and brow the marks of Thy Love and Passion, grant we beseech Thee, that through her intercession and merit, we may, pierced by the thorns of compunction, ever contemplate the sufferings of Thy Passion, who livest and reignest forever and ever. Amen.(emphasis added - source)
See this similar prayer to God through Mary:
(emphasis added - source)Prayer to Our Lady of Light
O radiant beam of celestial clarity,
O spotless Mother of infinite purity,
O seat of Wisdom and divine reliquary
of the Word Incarnate,
Hear my prayer,
O Queen of Light!
O Blessed Trinity,
Father, Son, and Holy Spirit,
You glorified my Mother, Mary,
as Queen of heaven and earth
and gave to her the gift of holding
Your Omnipotence in her holy hands,
Graciously grant what I seek
through her merits and intercession.
This can be further seen within the writings of Roman Catholicism. For example, Pious XII quotes with approval from a writing attributed to Eadmer (circa A.D. 1060 to circa A.D. 1124) as follows: "just as . . . God, by making all through His power, is Father and Lord of all, so the blessed Mary, by repairing all through her merits, is Mother and Queen of all; for God is the Lord of all things, because by His command He establishes each of them in its own nature, and Mary is the Queen of all things, because she restores each to its original dignity through the grace which she merited." (Ad Caeli Reginam (To the Queen of Heaven) section 36 - link)
It also can be seen in the "Catechism of the Catholic Church" section 956:
956 The intercession of the saints. "Being more closely united to Christ, those who dwell in heaven fix the whole Church more firmly in holiness.... They do not cease to intercede with the Father for us, as they proffer the merits which they acquired on earth through the one mediator between God and men, Christ Jesus.... So by their fraternal concern is our weakness greatly helped."(emphases and elipses in original - footnote omitted - source)
This is the point at which the Roman Catholic position comes into direct conflict with the unique mediatorial role of Christ (despite the contrary claim - anticipating this assertion of ours - that you see in CCC 956). Only by Christ's merits can we come before God. The merits of a mere man (like John Paul II, even assuming he were a godly man) are of infinitesimal value compared with the righteousness of Christ.
It is by Christ and by Christ alone that we have access to the Father - not by Mary, not by the saints. Even when we ask our fellow believers to pray for us, we do not (or at least we certainly ought not) ask them to do so on the basis of their own merits, but alone on the basis of Christ's merits.
We give token of this when we conclude our prayers, "in Jesus' name, Amen." That expression "In Jesus' name" is asking that God consider our prayer on the basis of Christ's merits, not our own. However, when someone prays the approved prayer for JP2's intercession, they are praying for God to consider JP2's merits. The same is the case (in general) with any prayers that are made either through or to the deceased in the Roman Catholic schema.
Prayers are to be offered through the merits of Christ and in the name of Christ. We are exhorted and encouraged to do so by Scripture:
23 And in that day ye shall ask me nothing. Verily, verily, I say unto you, Whatsoever ye shall ask the Father in my name, he will give it you. 24 Hitherto have ye asked nothing in my name: ask, and ye shall receive, that your joy may be full. 25 These things have I spoken unto you in proverbs: but the time cometh, when I shall no more speak unto you in proverbs, but I shall shew you plainly of the Father. 26 At that day ye shall ask in my name: and I say not unto you, that I will pray the Father for you: 27 For the Father himself loveth you, because ye have loved me, and have believed that I came out from God.
12 Verily, verily, I say unto you, He that believeth on me, the works that I do shall he do also; and greater works than these shall he do; because I go unto my Father. 13 And whatsoever ye shall ask in my name, that will I do, that the Father may be glorified in the Son. 14 If ye shall ask any thing in my name, I will do it.
11 According to the eternal purpose which he purposed in Christ Jesus our Lord: 12 In whom we have boldness and access with confidence by the faith of him.
19 Having therefore, brethren, boldness to enter into the holiest by the blood of Jesus, 20 By a new and living way, which he hath consecrated for us, through the veil, that is to say, his flesh; 21 And having an high priest over the house of God; 22 Let us draw near with a true heart in full assurance of faith, having our hearts sprinkled from an evil conscience, and our bodies washed with pure water.
1 Peter 3:12 For the eyes of the Lord are over the righteous, and his ears are open unto their prayers: but the face of the Lord is against them that do evil.
So let us pray in the name of the Lord to the Lord God Almighty, for the living, eschewing the superstition of praying for the dead, for it is written:
1 John 5:16-17
16 If any man see his brother sin a sin which is not unto death, he shall ask, and he shall give him life for them that sin not unto death. There is a sin unto death: I do not say that he shall pray for it. 17 All unrighteousness is sin: and there is a sin not unto death.
Psalm 2:12 Kiss the Son, lest he be angry, and ye perish from the way, when his wrath is kindled but a little. Blessed are all they that put their trust in him.
2 Corinthians 6:2 (For he saith, I have heard thee in a time accepted, and in the day of salvation have I succoured thee: behold, now is the accepted time; behold, now is the day of salvation.)
Hebrews 4:7 Again, he limiteth a certain day, saying in David, To day, after so long a time; as it is said, To day if ye will hear his voice, harden not your hearts.
7 For he is our God; and we are the people of his pasture, and the sheep of his hand. To day if ye will hear his voice, 8 Harden not your heart, as in the provocation, and as in the day of temptation in the wilderness: 9 When your fathers tempted me, proved me, and saw my work. 10 Forty years long was I grieved with this generation, and said, It is a people that do err in their heart, and they have not known my ways: 11 Unto whom I sware in my wrath that they should not enter into my rest.
Revelation 22:11 He that is unjust, let him be unjust still: and he which is filthy, let him be filthy still: and he that is righteous, let him be righteous still: and he that is holy, let him be holy still.
Isaiah 38:18 For the grave cannot praise thee, death cannot celebrate thee: they that go down into the pit cannot hope for thy truth.
If you are an unbeliever reading this, seize the day to repent of your sins and turn to Christ. Today you have life and hope, but tomorrow you may be in the grave, and in that grave no prayers will save you. So, if you do not trust in Christ alone for salvation, turn from your sins and set aside all other hope, placing it in Him alone for there is no other name under heaven by which men can be saved.
UPDATE: I note that Steve Hays has added some interesting points regarding prayers for the past (link). I should clarify that when I say that prayers for the dead are vain, I mean only to say that prayers for the dead as such are vain, without weighing in on the interesting, but more speculative, question of whether prayers for past events are appropriate (e.g. praying that one's loved one did not board a plane that you have just heard has crashed).