The Somnath temple story starts with the partiality of Chandra (the Moon God) to Rohini, one of his 27 wives who were all daughters of Daksha Prajapati, the son of Brahma. The sisters of Rohini were jealous of the extra attention that Rohini received and complained of this to their father. In spite of a warning, the Moon did not mend his ways and the angered Daksha Prajapati cursed him, because of which the Moon lost his lustre.
Alarmed with the curse of Daksha Prajapati, the Moon rushed to Prajapati Brahma, the creator of the World. Brahma advised him to visit Prabhas Teerth, bathe in the Triveni Sangam where the rivers Hiran, Saraswati, and Kapila meet and worship Lord Shiva there. The Moon did as he was advised and was relieved of his curse. As a token of gratitude he built a temple in Gold to honor Lord Shiva and the temple came to be known as Somnath.