"And the lamp of God had not yet gone out, and Samuel was lying down in the Temple of the Lord" etc. (I Samuel 3:3). Before the Holy One, blessed be He, causes the sun of one righteous person to set, He causes the sun of another righteous person to shine. On the day that Rabbi Akiva died, Rabbeinu HaKadosh was born, and concerning him they applied: "The sun also rises, and the sun goes down" (Ecclesiastes 1:5). On the day that Rabbeinu HaKadosh died, Rav Adda bar Ahava was born, and concerning him they applied: "The sun also rises, and the sun goes down." On the day that Rav Adda bar Ahava died, Rav Hamnuna was born, and concerning him they applied: "The sun also rises, and the sun goes down." On the day that Rav Hamnuna died, Rav Avin was born, and concerning him they applied: "The sun also rises, and the sun goes down." On the day that Rabbi Avin died, Abba Hoshaya the man of Tiria was born, and concerning him they applied: "The sun also rises, and the sun goes down." On the day that Abba Hoshaya the man of Tiria died, Rabbi Hoshaya his son was born, and concerning him they applied: "The sun also rises, and the sun goes down." Before the Holy One, blessed be He, caused the sun of Sarah to set, He caused the sun of Rebecca to shine, as it is said: "And Isaac brought her into the tent of Sarah his mother" (Genesis 24:67). Before the Holy One, blessed be He, caused the sun of Moses to set, He caused the sun of Joshua to shine: "And the Lord said to Moses, Take you Joshua the son of Nun" (Numbers 27:18). Before the Holy One, blessed be He, caused the sun of Joshua to set, He caused the sun of Othniel son of Kenaz to shine: "And Othniel son of Kenaz captured it" etc. (Judges 1:13). Before the Holy One, blessed be He, caused the sun of Eli to set, He caused the sun of Samuel to shine: "And the lamp of God had not yet gone out, and Samuel was lying down in the Temple of the Lord" etc.
God Sets One Righteous Sun and Raises Another from Sarah to Samuel
Midrash Shmuel 8:9
ונר אלהים טרם יכבה ושמואל שכב בהיכל ה' וגו' (שמואל א' ג' ג'), עד שלא ישקיע הקב"ה שמשו של צדיק הוא מזריח שמשו של צדיק אחר, יום שמת רבי עקיבא נולד רבינו הקדוש, וקראו עליו וזרח השמש ובא השמש (קהלת א' ה'), יום שמת רבינו הקדוש נולד רב אדא בר אהבה, וקראו עליו וזרח השמש ובא השמש, יום שמת רב אדא בר אהבה נולד רב המנונא, וקראו עליו וזרח השמש ובא השמש, יום שמת רב המנונא נולד רב אבין, וקראו עליו וזרח השמש ובא השמש, יום שמת רבי אבין נולד אבא הושעיא איש טירייא וקראו עליו וזרח השמש ובא השמש, יום שמת אבא הושעיא איש טירייא נולד רבי הושעיא בריה, וקראו עליו וזרח השמש ובא השמש, קודם שלא ישקיע הקדוש ברוך הוא שמשה של שרה, הזריח שמשה של רבקה, שנאמר ויביאה יצחק האהלה שרה אמו (בראשית כ"ד ס"ז), קודם שלא ישקיע הקדוש ברוך הוא שמשו של משה, הזריח שמשו של יהושע, ויאמר ה' אל משה קח לך את יהושע בן נון (במדבר כ"ז י"ח), קודם שלא ישקיע הקב"ה שמשו של יהושע, הזריח שמשו של עתניאל בן קנז, וילכדה עתניאל בן קנז וגו' (שופטים א' י"ג), קודם שלא ישקיע הקב"ה שמשו של עלי הזריח שמשו של שמואל, ונר אלהים טרם יכבה ושמואל שכב בהיכל ה' וגו'.