Q: Does James teach salvation by works? What exactly is the place of works in the life of the believer? Are works optional? If works are not optional, how can it be said that they are not required for salvation—in other words, that we are saved by works?
A: James does not teach of salvation by works. Rather, James harmonizes well with the rest of scripture.
James 2:14 (ESV)
14 What good is it, my brothers, if someone says he has faith but does not have works? Can that faith save him?
In this rhetorical question, James is pointing out that we will know our brothers by their fruit and a person who claims to have faith but has no works does not have real faith.
These are the people similar to those Jesus addressed in Matthew 7:21-23 (ESV) :
21 “Not everyone who says to me, ‘Lord, Lord,’ will enter the kingdom of heaven, but the one who does the will of my Father who is in heaven.
22 On that day many will say to me, ‘Lord, Lord, did we not prophesy in your name, and cast out demons in your name, and do many mighty works in your name?’
23 And then will I declare to them, ‘I never knew you; depart from me, you workers of lawlessness.’
This doesn’t mean that works are optional, it only means that works are not what causes salvation. Works are the right response to salvation, thus come after salvation and in no way cause salvation. All Christians should do good works as the right response to God’s grace.