After the Darkening of Valinor, with the aid of Yavanna and Nienna, the dying Trees of the Valar produced a last single flower, and a last single fruit. Of these, the fruit was borne by Laurelin, the Golden Tree. Filled with radiant fire, it was hallowed by Manwë, and set in a vessel made by Aulë and his people. To pilot the vessel, the Valar chose a fire-spirit of the Maiar: the maiden known as Arien, who took on the form of a naked flame before guiding the newly made Sun aloft.
The sun-maiden guided her charge into the skies above Valinor beyond the Western Sea, and so the first sunrise was in the West, not the east as it is today. In Middle-earth, the Elves had dwelt in darkness beneath the stars since Melkor destroyed the Lamps of the Valar long ages before. Now at last the Hither Lands were filled with brilliant light, bringing new life to the lands, and new hope to the Elves. As the Sun rose in the West, the first Men awoke in the eastern lands of Middle-earth, and the first thing they saw was the shining new light. Many of them followed the light across the Earth towards the western lands, and some eventually found their way into Beleriand to become the fathers of the Edain. Because of the time of their awakening, Men were known to the Elves as the Children of the Sun.
While Middle-earth stirred under the new light, Morgoth was dismayed by it, and for a while his power was checked. Even in the Third Age, most of the Orcs could not venture abroad in sunlight, and it was even powerful enough to turn trolls to stone, though eventually both Sauron and Saruman found ways to overcome this.
After the first sunrise in the West, Varda had planned for the Sun, and its companion the Moon, to remain forever in a nightless sky. She was persuaded against this by Lórien and Estë, and at last called the Sun back into Valinor: for those east of the Great Sea, this was the first sunset. From that time onward, the Sun descended each evening into the depths of the Outer Sea, and passed beneath the World, to rise again in the eastern sky as she does to this day.