(Painting by Marc Chagall)
The sun and the moon correspond to Moshe and Dovid HaMelech, which in turn relate to glory and kingship, which relate to Torah and prayer respectively. As is known, the years are counted according to the cycles of the sun, and the months according to the cycles of the moon. Therefore, on Rosh HaShanah, which is on Rosh Chodesh, the sun and the moon are like one, that is, both are equal in stature. This relates to the idea that the "light of the moon is like the light of the sun." This happens once the quality of prayer is increased by turning the Torah that one learns into prayer, and by praying that the Torah be sustained.