Others have insisted that while Paul is talking about justification salvifically in the divine court, James is talking about justification demonstrably in the human court. Yet this does not fit the evidence either. James frames the question of justifying faith salvifically in 2:14 (i.e. can such faith save them?). Further in verse 21 when speaking of Abraham's justifying faith, James nowhere mentions a 'human court'. In his epistle James presents justification always with reference to God (e.g. 2:23).
I have found Tom Schreiner's New Testament Theology very helpful in this regard. Schreiner doesn't look for traditional "pat" answers and, certainly in this instance, seems to let the text of Scripture breath without imposing a framework on the passage. According to Schreiner the apparent tension can be resolved by seeing Paul and James responding to different circumstances and situations. While Paul is concerned to demonstrate the extra-ordinary gift of righteousness that comes to sinners, James is more concerned with the problem of antinomianism. It is a mere difference in emphasis; while Paul emphasises gratuity, James emphasises obligation.
Further, the apparent tension can be resolved in a proper definition of faith. While faith and works can (and must!) be conceptually distinguished, in practice they cannot. One can conceptually distinguish between the sun's rays and the sun's heat, but in reality they are never separate. For James, God honouring works are so bound together with true faith that it's almost impossible to distinguish the two. Living faith is a faith that "works". Thus James can say, "You see that people are justified by what they do and not by faith alone" (2:24, TNIV). Thus Paul can say, "You are not saved by works. Nevertheless, you are saved FOR works." (Ephesians 2:8-10) To the extent that we miss James' emphasis, we also get justification wrong. I wonder how many Protestant denominations would haul James before a disciplinary committee to explain his remarks? I conclude with Schreiner:
The faith that saves, according to Paul, embraces Jesus Christ as Savior and Lord, placing one's life entirely in his hands. James criticizes a "faith" that notionally concurs with the gospel but does not grip the whole person. In other words, James does not disagree with Paul's contention that faith alone justifies, but he defines carefully the kind of faith that justifies. The faith that truly justifies can never be separated from works. Works will inevitably flow as the fruit of such faith. Faith that merely accepts doctrines intellectually but does not lead to a transformed life is "dead" (James 2:17, 26) and "useless" (James 2:20). Such faith does not "profit" (ophelos [James 2:14, 16 RSV]) in the sense that it does not spare one from judgement on the last day. Those who have dead and barren faith will not escape judgement. True faith is demonstrated by works (James 2:18). James does not deny that faith alone saves, but it is faith that produces (synergeo) works and is completed (teleioo) by works (James 2:22). The faith that saves is living, active and dynamic. It must produce works, just as compassion for the poor inevitably means that one cares practically for their physical needs (James 2:15-16). (p602, 603 New Testament Theology, Thomas R. Schreiner)