The story of Candra’s installation of Somesvara is found in the Skanda Purana and the Mahabharata. Although Candra, the moon-god, was married to all twenty-seven daughters of the progenitor Daksa, he was partial to Rohini, keeping her always with him and neglecting the others.
Annoyed, the other twenty-six wives complained to their father. After repeated warnings, Daksa cursed Candra to suffer from tuberculosis, lose his beauty and radiance, and wane into nothingness. Candra’s affliction disturbed the tides and the growth of vegetation. Sages asked Daksa to withdraw his curse, but he said he didn’t have the power to do so. He advised Candra to take refuge in Lord Siva. Candra came to Prabhasa with his wife Rohini, found the Jyotir-linga here, and worshiped Lord Siva in that form. Pleased, Lord Siva blessed Candra with fortnightly phases of waning and waxing. Because the moon regained his growth and light here, the place became known as Prabhasa (“to shine”).
Nearby from Somnath, one can also visit Pandava-gufa, a cave associated with Pandavas, who according to the Mahabharata did their penance at Prabhasa.