It is to be noticed that the only time we see the phrase "faith alone" in the Bible is in the book of James. However, while it is true this is the only place we see the explicit phrase used, it would be nonsense to limit the idea of "faith alone" to this one place. The entire purpose of Romans 3:27, 4:2-6, 9:10-11, 11:6, and Ephesians 2:9, for example, is that salvation is by faith without works: i.e. faith alone.
There is a Protestant saying that has been around for a long time: "We are justified by faith alone, but faith is never alone". This saying explains how faith, not works, justifies us, while pointing to the obvious fact that faith always produces action. If it does not, this shows there is really no faith but only the untrue profession of faith. The action James is drawing our attention to is nothing more than the proof of faith, which, according to James, confirms the account of Genesis, that "Abraham believed God and it was counted unto him for righteousness." This justification took place before Abraham did any work at all, but his faith was later tested and proved to be real by his action.
According to James, why was Abraham justified? Because he believed God (James 2:23). Yet by sacrificing his son Isaac, Abraham proved through this action that he believed God. Notice: he did not prove through his action that he was a good man, but that he believed God. His action, the necessary product of his faith, proved that he had faith in God's promise, that God would do what God said God would do, i.e. make a great nation through Isaac. Abraham proved that he really did believe God and therefore he was justified through faith alone, because his faith was real and was not alone.
It can now be seen how James stands firmly with Paul and not against him. James is not against justification by faith alone, but is against untrue professions of faith that are alone (that is, without faith-proving action). On the other hand, Paul writes against the idea that God justifies us on account of our works rather than on account of faith alone. To be specific, Paul is against the idea that when God judges the world in righteousness God will proclaim righteous (justify) those who are by their actions righteous. Paul is against the idea that people, by doing righteous deeds, are thereby righteous and will on this account be justified. To put it another way, he is against the idea that to be declared morally acceptable by God a person must by their actions be morally acceptable. But according to the Bible, as well as our experience, everyone is in fact unrighteous and sinful by their actions. Abraham was no exception. He, too, was a sinner - that is, a bad person - who did not achieve moral acceptability by his behavior.
Nevertheless, Abraham had faith in God's promise to him, which was given by God to him though he was a sinner, and he proved that he had real faith by his action. The most crucial thing to notice here - and the point that most people fail to notice - is that the action of Abraham which James draws our attention to was not action that showed he was a good person, but action that showed he believed God. Do you see the difference? James is not talking about good deeds that prove you are a good person, but action corresponding to your faith which proves that you believe. No one is good, and by works no one shows that they are good. We can only be justified through faith alone. But by our actions we can show that we believe.
Consider Abraham's faith-proving action which James points to. It was not a good deed. It had nothing to do with the law, nor was it an action that we would consider moral and universally obligatory. Abraham's faith was tested by God when God told him to extinguish the very son that God had promised would be the means of making for Abraham a great nation. God promised Abraham one thing, and then told Abraham to do something that would naturally eliminate all hope of fulfillment! This was a test to see whether Abraham believed God would fulfill His promise, despite all appearances to the contrary. Abraham believed! The Scripture tells us that he went to sacrifice Isaac believing God was able to raise his son from the dead (Heb. 11:17-19). When God saw this, He knew, not that Abraham was a good person, but that Abraham believed. It was not a moral deed which proved his moral worth, but a deed of faith which proved his faith.
James gives us a second example of justification through faith alone where faith is not alone. Who does he point to? None other than Rahab the prostitute! She, James tells us, was justified (James 2:25)! She was not justified (declared righteous) because she proved her righteousness by righteous doing. There is no mention of good deeds here. Rahab was a prostitute, and like everyone else in this world, she was not a good person. But like Abraham, Rahab had faith in God, and she proved that she had faith in God, not by performing any acts of righteousness, but by hiding the Israelite spies. That's all. She hid the spies, proving her faith was real and not an untrue profession, and therefore she was justified. It had nothing to do with being good.
This is where Mormonism, Roman Catholicism, Eastern Orthodoxy and even many Protestants misunderstand James, because they think he is writing about good works rather than about faith-proving action. They think James is saying that we need both faith and moral behavior in order to be justified, or that moral behavior is what proves that we have faith and are righteous. It is because they misunderstand James that they create conflict between him and Paul.
But, as the Scriptures tell us, God "justifies the ungodly", that is, the morally unacceptable, through faith alone (Rom. 4:5). Faith is never alone, for where there is real faith it is always proven by action. The two examples of Abraham and Rahab which James points to show us that this faith-proving action is not law-keeping or good works - not action that proves we are good people - but action that proves we believe. Thus this faith-proving action will be different depending on what our faith is. For Abraham, it was sacrificing Isaac. For Rahab, it was hiding the Israelite spies. For Christians, well, that's a topic for another article. The essential point to see in this article is: James is not talking about proving we are righteous by good works, but about proving we are believers by faith-proving action.
James and Paul have always been in agreement. It is their readers who wrongly pit them against each other.