וַיֹּאמֶר אֱלֹהִים יְהִי מְאֹרֹת (בראשית א, יד), רַבִּי יוֹחָנָן פָּתַח (תהלים קד, יט): עָשָׂה יָרֵחַ לְמוֹעֲדִים, אָמַר רַבִּי יוֹחָנָן לֹא נִבְרָא לְהָאִיר אֶלָּא גַּלְגַּל חַמָּה בִּלְבָד, אִם כֵּן לָמָּה נִבְרֵאת לְבָנָה, לְמוֹעֲדִים, כְּדֵי לְקַדֵּשׁ בְּחֶשְׁבּוֹנָהּ רָאשֵׁי חָדָשִׁים וְשָׁנִים. רַבִּי שִׁילֹה דִּכְפַר תְּמַרְתָּא בְּשֵׁם רַבִּי יוֹחָנָן אָמַר, אַף עַל פִּי שֶׁעָשָׂה יָרֵחַ לְמוֹעֲדִים, שֶׁמֶשׁ יָדַע מְבוֹאוֹ, מִשֶּׁמֶשׁ יָדַע מְבוֹאוֹ, אֵין מוֹנִין לַלְּבָנָה אֶלָּא מִשֶּׁתִּשְׁקַע הַחַמָּה. יוּסְטִי חַבְרָא בְּשֵׁם רַבִּי בֶּרֶכְיָה אָמַר, הֲרֵי הוּא אוֹמֵר (במדבר לג, ג): וַיִּסְעוּ מֵרַעְמְסֵס בַּחֹדֶשׁ הָרִאשׁוֹן בַּחֲמִשָּׁה עָשָׂר לַחֹדֶשׁ, וְאִם לַלְּבָנָה אַתָּה מוֹנֶה, עַד כַּדּוּן לֵית לָהּ אֶלָּא אַרְבַּע עֶשְׂרֵה מַטְמוֹעִין, הֱוֵי אֵין מוֹנִין לַלְבָנָה אֶלָּא מִשֶּׁתִּשְׁקַע הַחַמָּה. רַבִּי עֲזַרְיָה בְּשֵׁם רַבִּי חֲנִינָא אָמַר, לֹא נִבְרָא לְהָאִיר אֶלָּא גַּלְגַּל חַמָּה בִּלְבָד, אִם כֵּן לָמָּה נִבְרֵאת לְבָנָה, אֶלָּא מְלַמֵּד שֶׁצָּפָה הַקָּדוֹשׁ בָּרוּךְ הוּא שֶׁעֲתִידִין עוֹבְדֵי כּוֹכָבִים לַעֲשׂוֹתָן אֱלָהוּת, אָמַר הַקָּדוֹשׁ בָּרוּךְ הוּא מָה אִם מִשֶּׁהֵן מַכְּחִישִׁין זֶה אֶת זֶה עוֹבְדֵי כּוֹכָבִים עוֹשִׂין אוֹתָן אֱלָהוּת, אִלּוּ הָיוּ אֶחָד, עַל אַחַת כַּמָּה וְכַמָּה. רַבִּי בֶּרֶכְיָה בְּשֵׁם רַבִּי סִימוֹן אָמַר, שְׁנֵיהֶם נִבְרְאוּ לְהָאִיר, שֶׁנֶּאֱמַר (בראשית א, טו): וְהָיוּ לִמְאוֹרֹת (בראשית א, יז): וַיִּתֵּן אֹתָם אֱלֹהִים בִּרְקִיעַ הַשָּׁמַיִם. וְהָיוּ לְאֹתֹת, אֵלּוּ שַׁבָּתוֹת. וּלְמוֹעֲדִים, אֵלּוּ שָׁלשׁ רְגָלִים. וּלְיָמִים, אֵלּוּ רָאשֵׁי חֳדָשִׁים. וּלְשָׁנִים, זֶה קִדּוּשׁ שָׁנִים.
“God said: Let there be lights in the firmament of the heavens to distinguish between the day and the night; let them be for signs, for appointed times, for days, and years” (Genesis 1:14). “God said: Let there be lights” – Rabbi Yoḥanan began: “He made the moon for appointed times” (Psalms 104:19). Rabbi Yoḥanan said: It was only the sun that was created to illuminate. If so, why was the moon created? For the appointed times, in order to sanctify New Moons and years according to its calculation. Rabbi Shilo of Kefar Tamarta said in the name of Rabbi Yoḥanan: Even though “He made the moon for the appointed times,” “the sun knows its setting” (Psalms 104:19) – [the month is counted only] from the time that “the sun knows its setting.” One does not count [the months] by the moon until after the sun has set. Yusti Ḥavra said in the name of Rabbi Berekhya: It says: “They traveled from Rameses in the first month, on the fifteenth day of the month” (Numbers 33:3). If you count according to the moon, until now, there had been only fourteen sunsets. [We see] then that one counts for the moon only after the sun sets. Rabbi Azarya said in the name of Rabbi Ḥanina: It was only the sun that was created to illuminate. If so, why was the moon created? It is that it teaches that the Holy One blessed be He foresaw that the idolaters were destined to make them [the sun and the moon] into gods. The Holy One blessed be He said: If even when they challenge one another, the idolaters make them into gods, had there been only one [luminary], all the more so. Rabbi Berekhya said in the name of Rabbi Simon: Both of them were created to illuminate, as it is stated: “They shall serve as lights” (Genesis 1:15); “God set them in the firmament of the heavens [to illuminate upon the earth]” (Genesis 1:17). “Let them be for signs” – these are Shabbatot; “and for appointed times” – these are the three pilgrimage festivals; “for days” – these are New Moons; “and years” – this is the sanctification of years.