In most cultures throughout history, from ancient Rome to China, from the Americas to Africa, there has been a general trend (although there have been plenty of exceptions) in assigning a gender to the sun and moon. Especially in cultures most familiar to Westerners, the sun is usually male, and the moon is usually female. For instance, the sun is associated with male deities such as Ra, Horus, Apollo, etc, and the name itself- Sol - is masculine; the moon is generally associated with goddesses, and the name is explicitly feminine- Luna. I am not sure why the sun is usually conceived of as male, but the belief that the moon is feminine apparently stems from the perceived connection between moon cycles and menstruation.
In Lord of the Rings, however, people (and Elves, and Dwarves, and Hobbits) consistently refer to the sun as "she" or "her", and to the moon as "he" or "him". I doubt that Tolkien was making a statement about gender equality, but I haven't the foggiest idea as to why he chose to reverse the most common traditional gender assignments for the sun and moon. Does he say anything about this in his writing?