"And they put dust upon their heads" (Joshua 7:6). Rabbi Elazar said: they began to invoke the merit of Abraham our father, as it is said, "And I am but dust and ashes" (Genesis 18:27). They said: did not Abraham build an altar in Ai? Was it not so that his children might not fall in Ai?
Dust on Their Heads and the Pleading Merit of Abraham
Yalkut Shimoni on Nach 17:4
ויעלו עפר על ראשם (יהושע ז, ו). א"ר אלעזר התחילו מזכירים זכותו של אברהם אבינו שנאמר ואנכי עפר ואפר אמרו כלום בנה מזבח אברהם בעי אלא בשביל שלא יפלו בניו בעי: