Yeah, it's in reference to various mythologies anthropomorphizing the sun and moon, etc. Unfortunately, since we now know so much about the sun and moon, the idea of making up funny stories to explain their behavior is so far off the radar of most folks that this little trend from throughout history has started to fade into the mists of time.
The most colorful example of the moon and sun chasing each other I could find (easily) was the Inuit tale of Brother Moon and Sister Sun [http://en.wikipedia.org/wiki/Malina], which is a bit dark, but colorful.
Many cultures have a similar male/female dynamic in their sun/moon mythologies, but most assign the genders oppositely. Witness the Spanish for sun and moon: el sol y la luna. In the Spanish language, nouns are assigned gender (male, female, neuter) which determines usage. The sun is male ("el") the moon, female ("la").