The Sin of the Moon and its Rectification
(טז) וַיַּ֣עַשׂ אֱלֹהִ֔ים אֶת־שְׁנֵ֥י הַמְּאֹרֹ֖ת הַגְּדֹלִ֑ים אֶת־הַמָּא֤וֹר הַגָּדֹל֙ לְמֶמְשֶׁ֣לֶת הַיּ֔וֹם וְאֶת־הַמָּא֤וֹר הַקָּטֹן֙ לְמֶמְשֶׁ֣לֶת הַלַּ֔יְלָה וְאֵ֖ת הַכּוֹכָבִֽים׃

(16) Hashem made the two great lights, the greater light to dominate the day and the smaller light to dominate the night, and the stars.

רבי שמעון בן פזי רמי כתיב (בראשית א, טז) ויעש אלהים את שני המאורות הגדולים וכתיב את המאור הגדול ואת המאור הקטן אמרה ירח לפני הקב"ה רבש"ע אפשר לשני מלכים שישתמשו בכתר אחד אמר לה לכי ומעטי את עצמך ... אמר הקב"ה הביאו כפרה עלי שמיעטתי את הירח והיינו דאמר ר"ש בן לקיש מה נשתנה שעיר של ראש חדש שנאמר בו (במדבר כח, טו) לה' אמר הקב"ה שעיר זה יהא כפרה על שמיעטתי את הירח

Rabbi Shimon ben Pazi asked, it is written (Bereshis 1:16) "Hashem made the two great lights" and it is also written "the greater light and the smaller light." The moon said before Hashem, "Master of the universe, is it possible for two kings to use one crown (i.e. hold the same position)?" Hashem said to it, "Go and make yourself smaller"... Hashem said, "Bring an atonement for Me for reducing the size of the moon." And this is consistent with what Raish Lakish said, what is different about the goat offering on Rosh Chodesh that it says about it (Bamidbar 28:15) "for Hashem"? Hashem said that this goat will be an atonement for My reducing the size of the moon.

וִיהִי רָצוֹן מִלְּפָנֶיךָ יְהֹוָה אֱלֹהַי וֵאלֹהֵי אֲבוֹתַי לְמַלֹּאת פְּגִימַת הַלְּבָנָה וְלֹא יִהְיֶה בָּהּ שׁוּם מִעוּט. וִיהִי אוֹר הַלְּבָנָה כְּאוֹר הַחַמָּה וּכְאוֹר שִׁבְעַת יְמֵי בְרֵאשִׁית כְּמו שֶׁהָיְתָה קוֹדֶם מִעוּטָהּ. שֶׁנֶּאֱמַר אֶת שְׁנֵי הַמְּארוֹת הַגְּדוֹלִים:

And it should be the will before You Hashem our G-d and the G-d of my forefathers, to complete the missing part of the moon, and it should not be incomplete at all. And the light of the moon should be like the light of the sun and like the light of the seven days of creation before it was reduced, as it says "the two great lights."

(ט) ... הד' כי אור הלבנה נמשך מאור החמה כי הלבנה אין לה אורה מצד עצמה כי אם מאור השמש ומזה תקנו רז"ל בתפלת יוצר ראה והתקין צורת הלבנה כלומר שהיא צורה בלתי אורה, ומה שקורין רז"ל אור הלבנה באמרם אין בודקין לא לאור החמה ולא לאור הלבנה על האור הנאצל אליה מן החמה אמרו כן והוא כחום הברזל שהוחם באש שאין החום מצד הברזל רק מצד האש שהוא מחמם והברזל מקבל החמימות ממנו, ועל זה אמר והיו למאורות חסר וא"ו למארת כתיב כי שניהם אור אחד, וכן דרשו רז"ל לא נברא להאיר אלא גלגל חמה בלבד והוא קטרוג הלבנה שאמרה אי אפשר לשני מלכים שישתמשו בכתר אחד כי הכתר כנוי על האור והזוהר,

(9) The light of the moon comes from the light of the sun because the moon has no light of its own, but rather reflects the light of the sun... and that's why the vav is missing from the word "me'oros" (luminaries), to show that they are one light. And this is what is meant that the moon complained that two kings cannot use one crown, because "crown" refers to light, and the moon complained that it needed a light of its own.

(א) ויקרא שמו זרח. זרח על שם החמה, פרץ על שם הלבנה, ומלכות בית דוד בא מפרץ שהוא כנגד הלבנה. וידוע כי ימות הלבנה כ"ט יום וע"כ תמצא מפרץ בן יהודה עד צדקיהו כ"ט איש... הם כ"ט איש כנגד ימות הלבנה. וכשם שהלבנה שוקעת אחר כ"ט יום כן מלכות בית דוד נפסקה וחרב המקדש בימי צדקיהו שהוא כ"ט לפרץ. (ו) ומעתה התבונן בענין יהודה ותמר ושני הילדים האלה פרץ וזרח... וראוים היו פרץ וזרח להיותם נאצלים מתמר, כי הם כנגד חמה ולבנה הנאצלים מן האור הראשון הכולל זכר ונקבה, כי זרח כנגד החמה שזורחת תמיד בענין שוה, ופרץ כנגד הלבנה שהיא פעם מתמלאת פעם חסרה ונפרצת, ע"כ יתחייב מלכות בית דוד הבא מפרץ להיות בזמן מן הזמנים פעם קיים פעם בטל... ולפי שמלכות בית דוד בא מפרץ ופרץ כנגד הלבנה הזכירו חכמי האמת בחדוש הלבנה ושלח לי' סימנא דוד מלך ישראל חי וקיים. והמאמר הזה ע"ד פשוטו כי קרא הלבנה בשם דוד לפי שדוד בא מפרץ שהוא כנגד הלבנה ועוד שהלבנה נקראת המאור הקטן. וכתיב בדוד (ש"א יז) ודוד הוא הקטן. ובאמרו חי וקיים כונתו לומר נראית הלבנה.

(1) ויקרא שמו זרח, “he called his name Zerach.” The name Zerach (shines) symbolised the sun, whereas the name Peretz (interruption) symbolised the moon. We know that the moon’s orbit is completed every 29 days. This is why you will find that there were 29 righteous people (descended from him) listed in the Bible from the time of Peretz until the last King of the Davidic dynasty, Tzidkiyahu... These comprise a total of 29 men corresponding to the days in the lunar orbit; the lunar “sun” sets after such a period of time. The dynasty of David underwent a similar decline after Tzidkiyah and this is why the Temple was destroyed during the lifetime of Tzidkiyah who was the twenty-ninth scion counting from Peretz. (6) And now you will understand what occurred in the case of Yehudah, Tamar, and these two children born to Tamar and Yehudah respectively... Zerach corresponded to the element sun, the male element, the sun which shines without interruption, whereas Peretz corresponded to the element moon, the female element, a light which is uneven, sometimes stronger sometimes waning completely such as the light of the moon. It was therefore almost a historical must that the dynasty of King David be the product of Peretz rather than Zerach, seeing that he, Peretz — as indicated by his name already — represented the type of light we get from the moon, i.e. light which fluctuates constantly in intensity as does the light of the moon... Seeing that the kingdom of the house of David is derived from Peretz, and Peretz in turn has been likened to the moon, the sages formulated the words דוד מלך ישראל חי וקיים, “David King of Israel is alive and endures,” when we recite the monthly benedictions welcoming the arrival of the renewal of the light of the moon.

(ו) ויעקב נקרא קטן, והוא מונה מספר שלו למאור הקטן (שם). ומפני זה נקרא "אדום". ואמרו במדרש (ב"ר סג, יב) תבשילו אדום, שנאמר (בראשית כה, ל) "הלעיטני נא מן האדום". ארצו אדומה, שנאמר (בראשית לב, ג) "ארצה שעיר שדה אדום". גבוריו אדומים, שנאמר (ר' נחום ב, ד) "גבוריו מאדם". לבושיהן אדום, שנאמר (שם) "אנשי חיל מתולעים". ופורע ממנו אדום, שנאמר (שיה"ש ה, י) "דודי צח ואדום". בלבוש אדום, שנאמר (ישעיה סג, ב) "מדוע אדום ללבושך", עד כאן. ובארו בזה כי שם "אדום" ראוי אל עשו, ולכך כל אשר שייך אליו נקרא בשם "אדום". וכל זה מפני כי מקבל כחו מן החמה, אשר היא אדומה, וכדאיתא בבבא בתרא (פד. ) האי שמשא סומקתא היא. בשביל כך נקראת השמש חרסה, (שופטים יד, יח) "בטרם תבא החרסה", כי החרס הוא אדום. וכמו שנקרא המאור הקטן "לבנה" (ישעיה כד, כג) על שם הלבנות, כך נקראת השמש "חרסה" על שם האדמימות, ואין ספק בדבר זה:

Ya'akov is called small and his calendar is based on the small luminary (the moon). Edom (Esav) is called red, his food is red, his land is red, his warriors are red, his clothing is red... because Esav receives his strength from the sun which is red.