From the Catechism:
#1475 In the communion of saints, "a perennial link of charity exists between the faithful who have already reached their heavenly home, those who are expiating their sins in purgatory and those who are still pilgrims on earth. Between them there is, too, an abundant exchange of all good things." In this wonderful exchange, the holiness of one profits others, well beyond the harm that the sin of one could cause others. Thus recourse to the communion of saints lets the contrite sinner be more promptly and efficaciously purified of the punishments for sin.
#1476 We also call these spiritual goods of the communion of saints the Church's treasury, which is "not the sum total of the material goods which have accumulated during the course of the centuries. On the contrary the 'treasury of the Church' is the infinite value, which can never be exhausted, which Christ's merits have before God. They were offered so that the whole of mankind could be set free from sin and attain communion with the Father. In Christ, the Redeemer himself, the satisfactions and merits of his Redemption exist and find their efficacy."
#1477 "This treasury includes as well the prayers and good works of the Blessed Virgin Mary. They are truly immense, unfathomable, and even pristine in their value before God. In the treasury, too, are the prayers and good works of all the saints, all those who have followed in the footsteps of Christ the Lord and by his grace have made their lives holy and carried out the mission in the unity of the Mystical Body."#1475 reminds me of Paul's discourse on the unity of the body of Christ: If one part suffers, every part suffers with it; if one part is honored, every part rejoices with it. (1 Cor 12:26)
According to Dr. Ludwig Ott, Catholic theologian, the "source of Indulgences is the Church's treasury of satisfaction which consists of the superabundant satisfactions of Christ and of the Saints" is a doctrine that is "sententia certa." (Fundamentals of Catholic Dogma, p. 442) According to Ott, such a degree of certainty is "a teaching of the faith, theologically certain, ...a doctrine, on which the Teaching Authority of the Church has not yet finally pronounced, but whose truth is guaranteed by its intrinsic connection with the doctrine of revelation." (p. 9-10)
I lay terms, that all pretty much means it's a truth of the faith whether or not there has been an "official" pronouncement of the doctrine. One could probably find a number of theologians who would argue the Treasury of Merit is infallible teaching based on the consistent voice of the Ordinary Magisterium alone (which means the Church has been consistent on the teaching, even if a council of papal decree didn't write for the specific purpose of defining that issue as a Magisterial proclamation).
Anyway, the teaching is quite sound. At the heart of it, if the Church is the body of Christ (cf. Col 1:24, Eph. 1:22-23), then of course, the members are going to have merit - if they don't, then Christ himself doesn't have merit because he extends through his members. At the heart of opposing the doctrine is a denial of Christ himself!
Here is an excerpt Dr. Scott Hahn wrote on the subject:
How did Moses deliver them from the punishment they deserved? By invoking the merit of their ancestors. He told the Lord: "Remember Abraham, Isaac, and Israel, your servants, to whom you swore by yourself, and said to them, 'I will multiply your descendants as the stars of heaven, and all this land that I have promised I will give to your descendants, and they shall inherit it for ever'" (Ex 32:13).
Moses did not try to plead the case of the current generation, except insofar as they were offspring of the great patriarchs. In this story, we can see the temporal remission of punishment. God is going to destroy the Israelites; but he doesn't. We can see Moses' intercession, based upon the treasury of merits, the merit of the Fathers.
When the ancient rabbis discussed this story, they found no other way to explain it. The treasury of merit enabled them to safeguard God's mercy and his justice simultaneously. They applied the same principles to the stories of Noah, whose righteousness served to redeem future generations from the ravages of the flood, and David, whose goodness alone saved his son Solomon from the disaster he merited for himself. (Hahn, Scott, Signs of Life: 40 Catholic Customs and Their Biblical Roots, 192-193)There are all kinds of Scriptural examples of person A benefitting from the faith of person B. Think of the centurion's servant who is healed because of the faith of the centurian (Matt. 8:5-13), or the paralytic who was healed and forgiven because of the faith of his friends (Mark 2:3-5), or the Canaanite woman who interceded for her daughter, healed by Jesus through the faith of the mother (Matt. 15:22-28).
For a Church doc, refer to Indulgentarium Doctrina (1967) by Pope Paul VI:
This treasury also includes the truly immense, unfathomable and ever pristine value before God of the prayers and good works of the Blessed Virgin Mary and all the saints, who following in the footsteps of Christ the Lord and by His grace have sanctified their lives and fulfilled the mission entrusted to them by the Father. Thus while attaining their own salvation, they have also cooperated in the salvation of their brothers in the unity of the Mystical Body.Also, keyword search that document for "treasury" to find additional references. Notice the emphasis on unity of the body, tying into being joined to Christ's body, the Church.
Here are some other related Scriptural examples I think apply:
Sirach 29:9-13 Help a poor man for the commandment's sake, and because of his need do not send him away empty. Lose your silver for the sake of a brother or a friend, and do not let it rust under a stone and be lost. Lay up your treasure according to the commandments of the Most High, and it will profit you more than gold. Store up almsgiving in your treasury, and it will rescue you from all affliction; more than a mighty sheild and more than a heavy spear, it will fight on your behalf against your enemy.
Sirach 3:14 For kindness to a father will not be forgotten, and against your sins it will be credited to you.
Matthew 6:19-21 Do not lay up for yourselves treasures on earth, where moth and rust consume and where thieves break in and steal, but lay up for yourselves treasures in heaven, where neither moth nor rust consumes and where thieves do not break in and steal. For where your treasure is, there will your heart be also.
Matthew 19:16-30 Jesus advises rich man to give to poor to acquire treasure in heaven.
Mark 10:21 (parallel of Mat. 19) And Jesus looking upon him loved him, and said to him, "You lack one thing; go, sell what you have, and give to the poor, and you will have treasure in heaven; and come, follow me."
Proverbs 19:17 He who is generous to the dontrodden makes a loan to the LORD; He will repay him his due.Most of these quotes focus on treasury as it benefits the depositor (except for the Sirach 29 verse which also speaks of laying up treasure for one's "brother"). But I think they all apply to the Treasury of Merit which benefits satisfaction (CCC#1459-1460) for the depositor as well as others. The verses refer to acts of almsgiving and such and how that covers sin, is a "credit" or "loan" so to speak. It might be worth quoting CCC#1460 to quell any notion that Catholics believe that the Treasury of Merit or satisfaction for sin is something "man" does for himself:
CCC#1460 The satisfaction that we make for our sins, however, is not so much ours as though it were not done through Jesus Christ. We who can do nothing ourselves, as if just by ourselves, can do all things with the cooperation of "him who strengthens" us. Thus man has nothing of which to boast, but all our boasting is in Christ.