The following is an excerpt from
The MacArthur New Testament Commentary on James 2.
Because fallen man is morally and spiritually bankrupt, with no redeeming merit at all before God, nothing he can possibly do in himself and by his own power can make him right and acceptable before the Lord. It is for that reason that salvation has always been possible solely through the pure graciousness of God working through a faithful response to His grace. It is not that in the Old Testament men were saved through the law and that in the New they are saved by faith. At whatever point in the unfolding revelation and work of God men may have lived or will ever live, God requires nothing of them for salvation except true faith in Him. Hebrews 11 makes abundantly clear that both before and after the law was given at Sinai, salvation was by faith. Abraham “believed in the Lord,” Moses tells us; “and He reckoned it to him as righteousness” (Gen. 15:6).
Yet James says that the father of the faithful, whose very faith itself was a gift of God (Eph. 2:8), was nevertheless justified by works. That seeming contradiction, which has frustrated and confused believers throughout the history of the church, is clarified by understanding that justification by faith pertains to a person’s standing before God, whereas the justification by works that James speaks of in this verse pertains to a person’s standing before other men.
Some have further imagined a contradiction between James’s declaration that Abraham was justified by works and Paul’s unequivocal teaching that he was justified solely by grace through faith (Rom. 4:1–25; Gal. 3:6–9). Such is not the case, however. James has already emphasized that salvation is God’s gracious gift (1:17–18), and in verse 23 he quotes Genesis 15:6, which declares that God imputed righteousness to Abraham solely on the basis of his faith. Also, the specific event James said justified Abraham by works was the offering of Isaac (v. 21; cf. Gen. 22:9–12)—an event that occurred many years after he was declared righteous by God (Gen. 12:1–7; 15:6). James is teaching, then, that Abraham’s willingness to offer Isaac vindicates his faith before men—a teaching with which the apostle Paul was in wholehearted agreement (Eph. 2:10). There is thus no conflict between the two inspired writers.
It is important to understand that the Greek verb dikaioo (justified) has two general meanings. The first pertains to acquittal, that is, to declaring and treating a person as righteous. That is its meaning in relationship to salvation and is the sense in which Paul almost always uses the term. He declares, for example, that we are “justified as a gift by [God’s] grace through the redemption which is in Christ Jesus” (Rom. 3:24), “justified by faith apart from works of the Law” (3:28), and that, “having been justified by faith, we have peace with God through our Lord Jesus Christ” (5:1; cf. v. 9). In another letter he says, “Knowing that a man is not justified by the works of the Law but through faith in Christ Jesus, even we have believed in Christ Jesus, so that we may be justified by faith in Christ and not by the works of the Law; since by the works of the Law no flesh will be justified” (Gal. 2:16; cf. 3:11, 24). He reminds Titus that “being justified by His grace we [are] made heirs according to the hope of eternal life” (Titus 3:7).