“He built an altar to the Lord there” – Rabbi Elazar said: He built three altars; one for the good tidings of [being granted] the Land of Israel,56See Genesis 12:7. one for its acquisition,57See Genesis 13:18. and one so his descendants would not fall [in battle].58In this verse, Genesis 12:8. That is what is written [concerning the battle of Ai]: “Joshua rent his garments, fell on his face to the ground before the Ark of the Lord until the evening, he and the elders of Israel, and they put dust on their heads” (Joshua 7:6).
Rabbi Elazar ben Shamua said: They began evoking the merit of Abraham our forefather, as it is stated: “I am dust and ashes” (Genesis 18:27). Did Abraham not build an altar in Ai specifically so that his descendants should not fall [in battle] at Ai? “And proclaimed [vayikra] the name of the Lord” – this teaches that he caused all the people to proclaim the name of the Lord. Vayikra59Literally, he called. – he began converting proselytes to bring them under the wings of the Divine Presence.
“Abram journeyed, steadily journeying to the Negev” (Genesis 12:9). “Abram journeyed, steadily journeying to the Negev” – he directed his attention and charted his path toward the site of the Temple.