Joshua sent men from the camp near Jericho to the town of Ai, which is near Bethaven, east of Bethel. “Go and explore the land,” he told them. So they went and explored around Ai.
Then he moved on to the hill country east of Bethel and set up camp there. Bethel was to the west and Ai to the east. He built an altar to the Lord there and worshiped him.
Weep, people of Heshbon, for the town of Ai has been destroyed. Cry for help, people of Rabbah! Put on clothes made of sackcloth and start mourning; run to and fro inside your city walls, because your god Milcom will go into exile along with his priests and leaders.
Though you, Israel, have become a prostitute, may Judah not offend in the same way and not enter Gilgal, nor go up to Beth-aven, nor swear saying, ‘The Lord lives.’
Then Joshua, son of Nun, secretly sent out two spies from Shittim. “Go and explore the land, especially around Jericho,” he told them. So they went, and stayed at the house of woman named Rahab, a prostitute. There they spent the night.
When they returned they told Joshua, “The whole army isn't needed. Two or three thousand men is enough to go and attack Ai. Don't bother sending everyone—there's only a few of them.”
The Philistines gathered to fight against Israel. They had three thousand chariots, six thousand horsemen, and soldiers as numerous as sand on the seashore. They advanced and camped at Michmash, east of Beth-aven.