The fantasy author J. R. R. Tolkien of Middle-earth fame included Earth's sun and moon for the cosmology of his myths of Arda.
These astronomical bodies appear in various versions of The Silmarillion, a history of a world, called Middle-earth populated by Elves and other fantastic creatures as well as Men. A version of The Silmarillion, edited by the author's son and literary executor Christopher Tolkien, was posthumously published in 1977. However the Sun and Moon already appear in the author's writings dating from the 1920s.
The sun and moon in Tolkien's legendarium were described in the Narsilion, the "Song of the Sun and Moon".
The published Silmarillion states that the Sun was created by the Vala Aulë; he and his people made a vessel to hold the radiance of the last fruit of Laurelin. The vessel of the sun was guided by Arien, a Maia.
"...and Anar the Fire- fruit of Laurelin, they named the Sun. But the Noldor named [it] Vasa, the Heart of Fire, that awakens and consumes; for the Sun was set as a sign for the awakening of Men and the waning of the Elves..." (Silmarillion
Names of the Sun amongst the Elves included Anar or The Fire-golden, a name given to it by the Vanyar; Anor, the common name for the Sun in Sindarin, as seen in Minas Anor (later Minas Tirith) and the Gondorian province of Anórien; and Vása, or Heart of Fire, a name given to the Sun by the Noldor.
A poetic name for the Sun was The Daystar, and Gollum referred to it as The Yellow Face.
The Sun was seen by the Elves as made on behalf of Men, and they valued the Moon more highly. Morgoth's creatures, the Orcs, feared the Sun, and with the exception of the Uruk-hai, they did not travel while it was in the sky.
The Trolls of Middle-earth feared the Sun even more, and with great reason: they turned to stone under its light. Only the later Olog-hai were able to move under the Sun.
The Maia Tilion was chosen to guide the vessel of the Moon.
Isil was first wrought and made ready, and first rose into the realm of the stars, and was the elder of the new lights, as was Telperion of the Trees.
Names of the Moon amongst the Elves included Isil or The Sheen, a name given to it by the Vanyar; Ithil, the common name for the Moon in Sindarin, as seen in Minas Ithil (later Minas Morgul) and the Gondorian province of Ithilien; and Rána, or The Wayward, a name given to the Moon by the Noldor.
A poetic name for the Moon was The Silver Flower, and Gollum referred to it as The White Face.
The Moon was more highly valued than the Sun by the Elves, both because it came from the Elder Tree, and because it rose first.
In the early versions of The Silmarillion as described in The Book of Lost Tales 1, a part of The History of Middle-earth series, the Sun was described in great detail as an immense island of fire. The Moon was described as an immense island of crystal. It was also said there that the youth Tilion, who guided the Moon, was said to secretly be in love with Arien, the maiden who guided the Sun, and that because he steered the Moon too close to the Sun the Moon was burned, causing the darker spots on the Moon (the Lunar maria). Aulë devised vírin, a crystalline material from which he made a cup wherein the flower was set. The markings on the moon are caused as Lórien tried to pluck the "Rose of Silpion". The withered bough breaks, and the flower falls to the ground, and "a petal was crushed and tarnished" (HoME 1, p. 214). In a later version, the fruit of Laurelin also fell to the ground, when Aulë stumbled and its weight was too great for Tulkas to bear alone (HoME 1, pp. 207, 215, 226; HoME 4, p. 57)
In writings not included in the Silmarillion tradition, Morgoth at one point was infatuated with Arien, and wanted to claim her as his wife: he is at one point even described as ravishing her, so she abandoned her body and 'died': the Sun after this for a while left its course, burning a large part of Arda the world (apparently creating the deserts of Far Harad).
In writings which are older than the material from which the published Silmarillion was drawn, the Moon was described at one point as being created by Morgoth as a mockery of Arda the world, but this notion was abandoned.
In the Round World version of the legendarium, the Sun and the Moon were not the fruit of the Two Trees, but actually preceded the creation of the Trees. Instead, the Trees preserved the light of the Sun before it was tainted by Melkor when he ravished Arien.
The name of Narsil, the sword of King Elendil (later reforged for Aragorn as Andúril), contains the elements nar and thil, "fire" and "white light" respectively in Quenya, referring to the Sun and Moon.
The Man in the Moon is even described in those writings, as being an old Elf who secretly hid on the island of the Moon, and built a minaret there. This is alluded to further in Tolkien's Roverandom, in which the Man in the Moon also lives in a minaret. Combined with the Elven lore, as presented in the legendarium of The Silmarillion, the Man in the Moon of the Hobbits' tales must have his origins in the legend of Tilion the Maia. In The Book of Lost Tales, his name is given as Uolë Kúvion, but the tale of how he came to live there was never fully told.