There is an apparent contradiction between James 2:24 and other verses, such as Romans 3:27-28. How can man be justified by works, and not by faith only, at the same time as being justified by faith apart from the deeds of the law? Which is it: Faith alone, apart from works, or faith plus works?
A key hermeneutical principle is that scripture interprets scripture. That is, everything the Bible says must be interpreted in light of all other relevant passages. All verses addressing a topic must be taken together, not apart, for the Bible does not contain contradictions. What the Bible does contain, however, are things which are difficult to interpret. But there is a definite interpretation.
To establish this fact, go with me to 2 Peter 3:16, in which Peter says that in Paul's epistles "...are some things hard to understand, which untaught and unstable people twist to their own destruction, as they do also the rest of the Scriptures." From this, we see that Paul's epistles (which would include Romans) contain some difficult things to understand. This principle clearly applies to the rest of the scriptures, a fact which can be gleaned not only from the fact that Peter applies this principle to the rest of the scriptures, but also from the fact that not every difficult verse in the Bible comes from Paul's writings. Furthermore, Peter asserts that "untaught and unstable people" are able to twist the scriptures, which is not possible if there is no definite interpretation.
But how do we determine what that definite interpretation is? Here, we have two verses which seem to have two completely different definite interpretations. Seem to. This is where the Doctrine of Perspicuity comes into play. The Doctrine of Perspicuity is quite adequately summed up by Alistair Begg as "The plain things are the main things, and the main things are the plain things". The entire Bible is not easy to understand, but the central message and core doctrines are. Among these core doctrines are Sola Fide (faith alone) and Sola Gratia (by grace alone).
All throughout the scriptures, in both the Old and New Testaments, we see that faith is the key to our justification before God. If we were justified by our works, filthy sinners would have no chance. But we're all filthy sinners. We've all fallen short of God's Holy standard (Romans 3:23), and so even our righteous deeds are filthy rags (Isaiah 64:6). We've got no righteousness to boast of before God (Ephesians 2:9; Romans 3:27; 4:2 etc.), and so we cannot be justified before God by our works. Contrary to the claims of some denominations, there aren't even different categories of sin: Sin once, you're guilty of all (James 2:10). In a way, you could compare it to a peaceful death vs. a brutal death. If you're killed so quickly that your earthly body would not even be aware you had an accident, you are exactly as dead as a person stabbed repeatedly, feeling every blow before finally passing on. As two people physically killed are equally dead, so also are two sinners equally condemned.
In reality, justification before God comes through faith, not because of anything we've done, but because we trust in what He has done. The cross perfectly covers every sin (Hebrews 2:17; 1 John 2:2; 4:10 etc.), and so by mere belief in that, we are saved. But what is the result of that faith? It's obvious. If we believe that sin separates us from God, but Christ redeems us, we should treat sin as if it is deadly, and love God by obeying Him (John 14:15-21; 1 John 5:3).
And that is the purpose of James 2. James isn't talking about how to make yourself acceptable to God, which the rest of the Bible shows us is completely impossible, but about how to show that you are accepted by God by performing that which naturally flows from such faith. It is about showing justification (James 2:18), not about receiving it.
To illustrate this, James brings up Abraham as an example. Abraham believed God, and that was accounted to him for righteousness. At that point, Abraham was justified before God, and only through faith. Then Abraham offered up Isaac, justifying himself visibly. Proponents of justification by faith and works don't understand the order of this justification. When Abraham believed God, he was actually believing that God was going to give him Isaac in the first place (Genesis 15:1-6). In other words, he couldn't possibly have been justified by the work of offering up Isaac because Isaac had not even been conceived yet.
Abraham's belief of God was credited to him for righteousness, but Abraham eventually proved that he believed God. In Hebrews 11:17-19, we see conclusive proof that Abraham knew full well that Isaac was going to walk straight back down that mountain with him, because even if he had killed Isaac, Abraham knew God could raise him up again. God promised that He would give Abraham many descendants through Isaac, and Abraham believed Him. So why wouldn't Abraham offer up Isaac? If Abraham refused to offer Isaac, that would suggest he actually didn't believe God.
And so we see that when we take the entirety of scripture together, James 2:24 is not contrary to the rest of scripture. Rather, it has a definite interpretation that can be gathered through rigorous study. Unfortunately, like all scriptures, it can be twisted by the unstable and untaught, giving rise to many false "gospels" among many fake denominations. Let us not make the mistake of joining them, and instead honour Christ in all gratefulness for His works, which justify us before the Father through our faith in Him.