James 2:23-26 And the scripture was fulfilled which saith, Abraham believed God, and it was imputed unto him for righteousness: and he was called the Friend of God. Ye see then how that by works a man is justified, and not by faith only. Likewise also was not Rahab the harlot justified by works, when she had received the messengers, and had sent them out another way? For as the body without the spirit is dead, so faith without works is dead also.
This is actually a great question. Faith simply means belief, the individuals spoken of by James believe GOD and it showed in their works.
Hebrews 11: 1 - 2
Now faith is the substance of things hoped for, the evidence of things not seen.
2 For by it the elders obtained a good report.
See you get a good report by simply believing what GOD said. This is Abraham's report (his works)
Hebrews 11: 8 - 10, 17 - 19
8 By faith Abraham, when he was called to go out into a place which he should after receive for an inheritance, obeyed; and he went out, not knowing whither he went.
9 By faith he sojourned in the land of promise, as in a strange country, dwelling in tabernacles with Isaac and Jacob, the heirs with him of the same promise:
10 For he looked for a city which hath foundations, whose builder and maker is God.
17 By faith Abraham, when he was tried, offered up Isaac: and he that had received the promises offered up his only begotten son,
18 Of whom it was said, That in Isaac shall thy seed be called:
19 Accounting that God was able to raise him up, even from the dead; from whence also he received him in a figure.
This is Rahab's account
Hebrews 11: 31
31 By faith the harlot Rahab perished not with them that believed not, when she had received the spies with peace.