"All Masses are godless, therefore, except those by which consciences are encouraged for the strengthening of faith. A sacrifice is what we offer to God, but we do not offer Christ to God. But he himself offered up himself once for all. Therefore, those who perform Masses in order to do some good work or offer Christ to God for the living and the dead with the idea that the oftener this is repeated, the better they become, are caught in godless error. I think that for the most part these errors must be blamed on Thomas who taught that a Mass benefits others besides the one who partakes."
pg 146., "On Participation In The Lord's Supper", Philip Melanchthon's Loci Communes (Library of Christian Classics),
The Lord's Supper is referred to as a "sacrifice" verify early in Church History, even in the Apostolic Fathers. Here's an example of the Didache (which may have been written before the New Testament was completed.):
"Christian Assembly on the Lord's Day. But every Lord's day gather yourselves together, and break bread, and give thanksgiving after having confessed your transgressions, that your sacrifice may be pure. But let no one who is at odds with his fellow come together with you, until they be reconciled, that your sacrifice may not be profaned. For this is that which was spoken by the Lord: "In every place and time offer to me a pure sacrifice; for I am a great King, says the Lord, and my name is wonderful among the nations." ~ Chapter 14., Didache
What's most interesting about Melanchthon's comments in Loci, is that he concludes that the degeneration of the Eucharist to the point that only the Priest took both species of the Mass, and that those species could be later sold to benefit others.
This discussion about whether the Lord's Supper benefits others, is relevant to the Baptist dogma that excludes Children of believers in Christian household from participating in either the Lord's Supper (padeocommunion) or Baptism (padeobaptism). It's also relevant to almost everyone, because children are not permitted to the Lord's Table in any large Church Body (except possibly Eastern Orthodox). So it seems that when the Church collectively partakes in the Eucharist, that children, catechumen and other non-nonparticipating members of the household of faith somehow participate based on the faith of the spiritual parent.
Melanchthon's comments in Loci seem to be considering whether the benefits of the Lord's Supper can be communicated to those outside the Church, and that answer seems to be no.
I've cited at length the section from Thomas Aquinas' Summa Theologica that Melanchthon refers here:
Whether this sacrament benefit others besides the recipients?
Objection 1: It seems that this sacrament benefits only the recipients. For this sacrament is of the same genus as the other sacraments, being one of those into which that genus is divided. But the other sacraments only benefit the recipients; thus the baptized person alone receives effect of Baptism. Therefore, neither does this sacrament benefit others than the recipients.
Objection 2: Further, the effects of this sacrament are the attainment of grace and glory, and the forgiveness of sin, at least of venial sin. If therefore this sacrament were to produce its effects in others besides the recipients, a man might happen to acquire grace and glory and forgiveness of sin without doing or receiving anything himself, through another receiving or offering this sacrament.
Objection 3: Further, when the cause is multiplied, the effect is likewise multiplied. If therefore this sacrament benefit others besides the recipients, it would follow that it benefits a man more if he receive this sacrament through many hosts being consecrated in one mass, whereas this is not the Church's custom: for instance, that many receive communion for the salvation of one individual. Consequently, it does not seem that this sacrament benefits anyone but the recipient.
On the contrary, Prayer is made for many others during the celebration of this sacrament; which would serve no purpose were the sacrament not beneficial to others. Therefore, this sacrament is beneficial not merely to them who receive it.
I answer that, As stated above, this sacrament is not only a sacrament, but also a sacrifice. For, it has the nature of a sacrifice inasmuch as in this sacrament Christ's Passion is represented, whereby Christ "offered Himself a Victim to God" (Eph. 5:2), and it has the nature of a sacrament inasmuch as invisible grace is bestowed in this sacrament under a visible species. So, then, this sacrament benefits recipients by way both of sacrament and of sacrifice, because it is offered for all who partake of it. For it is said in the Canon of the Mass: "May as many of us as, by participation at this Altar, shall receive the most sacred body and blood of Thy Son, be filled with all heavenly benediction and grace."
But to others who do not receive it, it is beneficial by way of sacrifice, inasmuch as it is offered for their salvation. Hence it is said in the Canon of the Mass: "Be mindful, O Lord, of Thy servants, men and women . . . for whom we offer, or who offer up to Thee, this sacrifice of praise for themselves and for all their own, for the redemption of their souls, for the hope of their safety and salvation." And our Lord expressed both ways, saying (Mat. 26:28, with Lk. 22:20): "Which for you," i.e. who receive it, "and for many," i.e. others, "shall be shed unto remission of sins."
Reply to Objection 1: This sacrament has this in addition to the others, that it is a sacrifice: and therefore the comparison fails.
Reply to Objection 2: As Christ's Passion benefits all, for the forgiveness of sin and the attaining of grace and glory, whereas it produces no effect except in those who are united with Christ's Passion through faith and charity, so likewise this sacrifice, which is the memorial of our Lord's Passion, has no effect except in those who are united with this sacrament through faith and charity. Hence Augustine says to Renatus (De Anima et ejus origine i): "Who may offer Christ's body except for them who are Christ's members?" Hence in the Canon of the Mass no prayer is made for them who are outside the pale of the Church. But it benefits them who are members, more or less, according to the measure of their devotion.
Reply to Objection 3: Receiving is of the very nature of the sacrament, but offering belongs to the nature of sacrifice: consequently, when one or even several receive the body of Christ, no help accrues to others. In like fashion even when the priest consecrates several hosts in one mass, the effect of this sacrament is not increased, since there is only one sacrifice; because there is no more power in several hosts than in one, since there is only one Christ present under all the hosts and under one. Hence, neither will any one receive greater effect from the sacrament by taking many consecrated hosts in one mass. But the oblation of the sacrifice is multiplied in several masses, and therefore the effect of the sacrifice and of the sacrament is multiplied.
Thomas Aquinas, Summa Theologica, III, q. 79, a. 7
Thomas argument depends on understanding the Mass as a sacrifice, and this argument was later dismantled by John Calvin in his Institutes. The root of it appears that the Eurcharist has a receiving and giving synthesis to it, such that by receiving the sacrifice, prayers are then offered for the benefit of others.
Who am I to go against Melanchthon and Calvin?
Related: Benefits, Didache, Eucharist, John Calvin, Loci Communes, lord's supper, Philip Melanchthon, Sacrifice, Summa Theological, Thomas Aquinas