In these verses we have,

I. The prudence of Joshua, in sending spies to observe this important pass, which was likely to be disputed at the entrance of Israel into Canaan (Josh. 2:1). Go view the land, even Jericho. Moses had sent spies (Num. 13:1-33) Joshua himself was one of them and it proved of ill consequence. Yet Joshua now sent spies, not, as the former were sent, to survey the whole land, but Jericho only; not to bring the account to the whole congregation, but to Joshua only, who, like a watchful general, was continually projecting for the public good, and, was particularly careful to take the first step well and not to stumble at the threshold. It was not fit that Joshua should venture over Jordan, to make his remarks incognitoin disguise; but he sends two men (two young men, says the LXX.), to view the land, that from their report he might take his measures in attacking Jericho. Observe, 1. There is no remedy, but great men must see with other people’s eyes, which makes it very necessary that they be cautious in the choice of those they employ, since so much often depends upon their fidelity. 2. Faith in God’s promise ought not to supersede but encourage our diligence in the use of proper means. Joshua is sure he has God with him, and yet sends men before him. We do not trust God, but tempt him, if our expectations slacken our endeavours. 3. See how ready these men were to go upon this hazardous enterprise. Though they put their lives in their hands yet they ventured in obedience to Joshua their general, in zeal for the service of the camp, and in dependence upon the power of that God who, being the keeper of Israel in general, is the protector of every particular Israelite in the way of his duty.

II. The providence of God directing the spies to the house of Rahab. How they got over Jordan we are not told; but into Jericho they came, which was about seven or eight miles from the river, and there seeking for a convenient inn were directed to the house of Rahab, here called a harlot, a woman that had formerly been of ill fame, the reproach of which stuck to her name, though of late she had repented and reformed. Simon the leper (Matt. 26:6), though cleansed from his leprosy, wore the reproach of it in his name at long as he lived; so Rahab the harlot; and she is so called in the New Testament, where both her faith and her good works are praised, to teach us, 1. That the greatness of sin is no bar to pardoning mercy if it be truly repented of in time. We read of publicans and harlots entering into the kingdom of the Messiah, and being welcomed to all the privileged of that kingdom, Matt. 21:31. 2. That there are many who before their conversion were very wicked and vile, and yet afterwards come to great eminence in faith and holiness. 3. Even those that through grace have repented of the sins of their youth must expect to bear the reproach of them, and when they hear of their old faults must renew their repentance, and, as an evidence of that, hear of them patiently. God’s Israel, for aught that appears, had but one friend, but one well-wisher in all Jericho, and that was Rahab a harlot. God has often served his own purposes and his church’s interests by men of different morals. Had these scouts gone to any other house than this they would certainly have been betrayed and put to death without mercy. But God knew where they had a friend that would be true to them, though they did not, and directed them thither. Thus that which seems to us most contingent and accidental is often over-ruled by the divine providence to serve its great ends. And those that faithfully acknowledge God in their ways he will guide with his eye. See Jer. 36:19, 26.

III. The piety of Rahab in receiving and protecting these Israelites. Those that keep public-houses entertain all comers, and think themselves obliged to be civil to their guests. But Rahab showed her guests more than common civility, and went upon an uncommon principle in what she did; it was by faith that she received those with peace against whom her king and country had denounced war, Heb. 11:31. 1. She bade them welcome to her house; they lodged there, though it appears by what she said to them (Josh. 2:9) she knew both whence they came and what their business was. 2. Perceiving that they were observed coming into the city, and that umbrage was taken at it, she hid them upon the roof of the house, which was flat, and covered them with stalks of flax (Josh. 2:6), so that, if the officers should come thither to search for them, there they might lie undiscovered. By these stalks of flax, which she herself had lain in order upon the roof to dry in the sun, in order to the beating of it and making it ready for the wheel, it appears she had one of the good characters of the virtuous woman, however in others of them she might be deficient, that she sought wool and flax, and wrought willingly with her hands, Prov. 31:13. From this instance of her honest industry one would hope that, whatever she had been formerly, she was not now a harlot. 3. When she was examined concerning them, she denied they were in her house, turned off the officers that had a warrant to search for them with a sham, and so secured them. No marvel that the king of Jericho sent to enquire after them (Josh. 2:2, 3); he had cause to fear when the enemy was at his door, and his fear made him suspicious and jealous of all strangers. He had reason to demand from Rahab that she should bring forth the men to be dealt with as spies; but Rahab not only disowned that she knew them, or knew where they were, but, that no further search might be made for them in the city, told the pursuers they had gone away again and in all probability might be overtaken, Josh. 2:4, 5. Now, (1.) We are sure this was a good work: it is canonized by the apostle (Jas. 2:25), where she is said to be justified by works, and this is specified, that she received the messengers, and sent them out another way, and she did it by faith, such a faith as set her above the fear of man, even of the wrath of the king. She believed, upon the report she had heard of the wonders wrought for Israel, that their God was the only true God, and that therefore their declared design upon Canaan would undoubtedly take effect and in this faith she sided with them, protected them, and courted their favour. Had she said, “I believe God is yours and Canaan yours, but I dare not show you any kindness,” her faith had been dead and inactive, and would not have justified her. But by this it appeared to be both alive and lively, that she exposed herself to the utmost peril, even of life, in obedience to her faith. Note, Those only are true believers that can find in their hearts to venture for God; and those that by faith take the Lord for their God take his people for their people, and cast in their lot among them. Those that have God for their refuge and hiding-place must testify their gratitude by their readiness to shelter his people when there is occasion. Let my outcasts dwell with thee, Isa. 16:3, 4. And we must be glad of an opportunity of testifying the sincerity and zeal of our love to God by hazardous services to his church and kingdom among men. But, (2.) There is that in it which it is not easy to justify, and yet it must be justified, or else it could not be so good a work as to justify her. [1.] It is plain that she betrayed her country by harbouring the enemies of it, and aiding those that were designing its destruction, which could not consist with her allegiance to her prince and her affection and duty to the community she was a member of. But that which justifies her in this is that she knew the Lord had given Israel this land (Josh. 2:9), knew it by the incontestable miracles God had wrought for them, which confirmed that grant; and her obligations to God were higher than her obligations to any other. If she knew God had given them this land, it would have been a sin to join with those that hindered them from possessing it. But, since no such grant of any land to any people can now be proved, this will by no means justify any such treacherous practices against the public welfare. [2.] It is plain that she deceived the officers that examined her with an untruth—That she knew not whence the men were, that they had gone out, that she knew not whither they had gone. What shall we say to this? If she had either told the truth or been silent, she would have betrayed the spies, and this would certainly have been a great sin; and it does not appear that she had any other way of concealing them that by this ironical direction to the officers to pursue them another way, which if they would suffer themselves to be deceived by, let them be deceived. None are bound to accuse themselves, or their friends, of that which, though enquired after as a crime, they know to be a virtue. This case was altogether extraordinary, and therefore cannot be drawn into a precedent; and that my be justified here which would be by no means lawful in a common case. Rahab knew, by what was already done on the other side Jordan, that no mercy was to be shown to the Canaanites, and thence inferred that, if mercy was not owing them, truth was not; those that might be destroyed might be deceived. Yet divines generally conceive that it was a sin, which however admitted of this extenuation, that being a Canaanite she was not better taught the evil of lying; but God accepted her faith and pardoned her infirmity. However it was in this case, we are sure it is our duty to speak every man the truth to his neighbour, to dread and detest lying, and never to do evil, that evil, that good may come of it, Rom. 3:8. But God accepts what is sincerely and honestly intended, though there be a mixture of frailty and folly in it, and is not extreme to mark what we do amiss. Some suggest that what she said might possibly be true of some other men.