KJV Below (Link to NIV)
24 Ye see then how that by works a man is justified, and not by faith only.
25 Likewise also was not Rahab the harlot justified by works, when she had received the messengers, and had sent them out another way?
26 For as the body without the spirit is dead, so faith without works is dead also.
James is not saying your works are what saves you. However, he is saying that your doctrine is also not what saves you. The kind of faith that saves us (that “justifies” us, or makes us righteous), is one that leads to works. As an example he points to Rahab. She didn’t know anything about who Yahweh was or what promises Yahweh made. She knew the gods of Jericho and they were not the God of the Hebrews. However, she decided to trust in this God whom she’d only heard a whisper of, and in doing so saved the spies. That act of faith, which was far from a fully formed and sound dogma, was enough to bring her into the covenant people. Faith is not something done in the head, it happens in the heart.
Do you sometimes feel spiritually dead? Have you lost the passion of that faith which is yours? What are some ways to restore that passion? Rahab didn’t seem to know exactly what she was doing when she stepped out in faith, are we sometimes slow to act upon our faith because of our uncertainty?