Joshua, Chapter 2, Verse 8-9
8 Before the spies lay down, Rahab went up to them on the roof 9 and said: “I know that the LORD has given you the land, that a dread of you has come upon us, and that all the inhabitants of the land tremble with fear because of you.
Rahab saved the spies of Israel. Why? She knew the truth that God was with Israel. Rahab was a survivor and a sinner; she knew God had given the land to Israel. If you know the truth you do not swerve from it. Rahab was saved from the fate of Jericho because of her action not just good will toward Israel. James in his epistle puts it this way: 20Do you want proof, you ignoramus, that faith without works is useless? 21 Was not Abraham our father justified by works when he offered his son Isaac upon the altar? 22 You see that faith was active along with his works, and faith was completed by the works. 23 Thus the scripture was fulfilled that says, “Abraham believed God, and it was credited to him as righteousness,” and he was called “the friend of God.”24 See how a person is justified by works and not by faith alone. 25 And in the same way, was not Rahab the harlot also justified by works when she welcomed the messengers and sent them out by a different route?
Rahab was saved by her faith and actions by the God of Israel and as a result she is not only saved but the Christ the Messiah descends from Boaz her son.