James, being a very devout Jew and leading the Jerusalem Church for 19 years trying desperately to reconcile Christianity to the Jewish Temple system, James states (2:24) 'Ye see then how that by works a man is justified, and not by faith only'. The preceeding verses James tried to give the examples of Abraham and Rahab, citing deeds (works) as fulfillemnt of their faith, and Jmaes tries to infer that the deeds are the focus of being saved, as if the deeds must show to complete faithe. But what were Rahab's works? Prostitution and lying when she hid the spies.
If you read the OT story, it was Rahab's faithe (action based upon belief in the promise sustained by confidence in the promiser) that when she let down the red cord she would be spared as the city fell.
With Abraham, James claims that Abraham offered his son and that work was counted for him righteousness. Yet in the OT story we have two clues greater than the knife glinting in the air: when Isaac asks where is the sacrifice to be offered, Abraham says 'God will provide'. Then, just before going up the mount to do the sacrifice, Abraham tells the servants to wait at the foot of the mount and 'they' will come back down to them ... even if Abraham had to offer Isaac, Abraham was so given to the 'amen' of God's promise that in Isaac would Abraham's seed be called that Abraham believed God would raise him from the dead if necessary to fulfill His promises. James used a crafty deceptive wording to defend his position that faith plus works was necessary for salvation.
http://www.desiringgod.org/ResourceLibrary/Sermons/ByScripture/13/1085_Does_James_Contradict_Paul/
The above is a site where Reformed doctrine is preached. The man in question, DR. John Piper, is an excellant source of wisdom and insite. He does a much better job than me. Please read it if you can access it.
Matt 5:16 Let your light so shine before men, that they may see your good works, and glorify your Father which is in heaven.When we stand before God the emphasis in on grace. When we stand before men, the emphasis is on works