In Matthew 5:20 Christ instructs his followers, "Unless your righteousness surpasses that of the scribes and Pharisees, you will not enter into the kingdom of heaven." This is an important, though often misunderstood verse when employed in Protestant-Catholic discussions of justification.
Some Catholics cite the passage, but leave the impression the Catholic Church teaches we must attain righteousness by our own efforts: God gives us a certain amount of grace to make of it, by our own power, what we will. To Protestants, this sounds (understandably) like semi-Pelagianism.
Protestants misunderstand the passage because they try to rob it of its moral force. Jesus, they claim, is revealing the futility of trying to achieve righteousness through good deeds. He's really contrasting the false righteousness of good works with the true, merely imputed, declaratory righteousness that comes through faith alone.
Both interpretations of the passage miss something. The pseudo-Catholic view is wrong because the Catholic Church rejects semi-Pelagianism--the belief God does half and we do half--as forcefully as any Protestant church.
The great Thomist Garrigou-Lagrange (quoted in Louis Bouyer's The Spirit and Forms of Protestantism, p. 53) summarized the Catholic position when he observed that "in the work of salvation all is from God, including our own co-operation, in the sense that we cannot distinguish a part as exclusively ours, which does not come from the author of all good."
From the Catholic point of view, God initiates our salvation by his grace, but he doesn't stop there. Our works of obedience which follow the start of God's salvific action in us are also the work of grace.
This is what Paul means in Philippians 2:12-13 when he says we're to work out our salvation and yet reminds us that "it is God who, for his good purpose, works in you both to desire and to work." Or as Augustine put it, when God rewards our merits or works, he crowns his own gifts to us.
The common Fundamentalist use of Matthew 5:20 also misses the mark. Jesus isn't contrasting imputed righteousness with the righteousness of good works. He's contrasting the external righteousness of the scribes and Pharisees with the interior righteousness that proceeds from the heart and which is to characterize his followers. Jesus is telling his disciples how to be righteous--not how to look righteous.
This is illustrated in Matthew 5 in Christ's teaching about anger and murder (Matt. 5:21-26), lust and adultery (Matt. 5:27-32), oaths and truth telling (Matt. 5:33-37), retaliation (Matt. 5:38-42), and the love of enemies (Matt. 5:43-48). In each of these areas, the concern is for internal righteousness and sanctity surpassing external performance.
The same principle applies to Christ's treatment of the three characteristic forms of Jewish piety in Matthew 6:1-18: almsgiving, prayer, and fasting. Jesus doesn't deny these are righteous deeds or good works. His concern is that such acts be done authentically--that is, because of the love of God, not merely "that people may see them" (Matt. 6:1).
Although Christ is interested in heartfelt obedience rather than mere external performance, nowhere does he say external performance is unimportant or that genuine works of obedience shouldn't be considered righteous deeds before God.
In fact, his warning to "take care not to perform righteous deeds in order that people may see" suggests just the opposite, as do his admonition in Matthew 6:33 to "seek first the kingdom of God and his righteousness" and his teaching that we must do the will of the Father to enter the kingdom (Matt. 7:21).
How, then, does Jesus teach his followers to surpass the righteousness of the scribes and Pharisees? By obeying God from the heart, not simply with the lips.
This is not some sort of imputed, extrinsic, "looking-at-the-believer-through-Jesus-colored-glasses" righteousness. No, it's the result of a grace-created interior transformation in which believers can grow through authentic obedience (1 John 3:7) as true children of God (Matt. 5:45).