Shemot / Exodus 17:11 · Remez
וְהָיָה כַּאֲשֶׁר יָרִים מֹשֶׁה יָדוֹ וְגָבַר יִשְׂרָאֵל וְכַאֲשֶׁר יָנִיחַ יָדוֹ וְגָבַר עֲמָלֵק׃
And it came to pass, when Moshe held up his hand, that Israel prevailed, and when he let down his hand, Amalek prevailed.
Remez רֶמֶז
The hand that stopped the sun
A disciple who grew up beside his teacher sometimes repeats his path step by step. The midrash sets side by side Moshe (Moses) and Yehoshua (Joshua), who on this day led an army for the first time.
Midrash Tanchuma lists how Yehoshua inherited the honor of Moshe: both removed their shoes before holiness, both sang, both built an altar and wrote the Torah. And both stopped the sun: in the word "held up" (יָרִים) the midrash hears the prophet's verse, where "on high (רוֹם) it lifted its hands" stands beside "sun and moon stood still".
How Midrash Tanchuma explain it
Midrash Tanchuma "The wise shall inherit honor" (Mishlei / Proverbs 3:35)
Another explanation. "The wise shall inherit honor": this is Yehoshua, who inherited honor from Moshe our teacher. For the Holy One, blessed is He, said to him: "As I was with Moshe, so will I be with you" (Yehoshua / Joshua 1:5). To Moshe the Holy One, blessed is He, said: "Remove your shoes from your feet" (Shemot / Exodus 3:5), and to Yehoshua: "And the captain of the Eternal's host said to Yehoshua: remove your shoe from your foot" (Yehoshua / Joshua 5:15).
Of Moshe it is written: "Then Moshe and the children of Israel sang" (Shemot / Exodus 15:1). And of Yehoshua: "Then Yehoshua spoke to the Eternal on the day the Eternal delivered" (Yehoshua / Joshua 10:12). Moshe brought them out of Egypt, and Yehoshua brought them into the land. Moshe killed Sichon (Sihon) and Og, and Yehoshua thirty-one kings.
Moshe stopped the sun in the war with Amalek, as it says: "And it came to pass, when Moshe held up" (Shemot / Exodus 17:11). And "held up" (יָרִים) means only that he stopped the sun, as it says: "The deep gave forth its voice, it lifted its hands on high (רוֹם)" (Chavakuk / Habakkuk 3:10). And Yehoshua likewise, as it says: "Sun, stand still over Gibeon, and moon, over the valley of Ayalon" (Yehoshua / Joshua 10:12).
Moshe built an altar, as it says: "And Moshe built an altar" (Shemot / Exodus 17:15). And Yehoshua likewise: "Then Yehoshua built an altar" (Yehoshua / Joshua 8:30). Moshe wrote the Torah, as it says: "And Moshe wrote this Torah" (Devarim / Deuteronomy 31:9). And Yehoshua likewise: "And Yehoshua wrote these words in the book of the Torah of the Almighty" (Yehoshua / Joshua 24:26). So, in everything.
Takeaway
Wordplay: "held up" (יָרִים) and "on high" (רוֹם) share the root ר־ו־ם. In the prophet, right after "lifted its hands on high" it says: "sun and moon stood still in their dwelling" (Chavakuk / Habakkuk 3:11). So the midrash reads Moshe's raised hands as stopping the sun.
The next verse says Moshe's hands were "steady until the sun set" (Shemot / Exodus 17:12). The midrash understands: the sun did not set until Israel won.
Yehoshua commanded the army in the battle with Amalek (Shemot / Exodus 17:9). This is his first appearance in the Torah.