The Navagrahas were created to maintain the balance of creation through their powers which would enable the Universe to sustain in harmony with all the elements. Among these, the role of the Sun God and the Moon God is the most significant one who define the very day and night times of the Universe. One cannot imagine our Mother Earth and life on it to sustain without the power of both these deities. While the Sun God travels without a break providing energy to the world, the moon god provides the tides and currents of the Oceans which help us develop rainfall and water resources. A story as to how the moon developed the waxing (Poornima) and waning (Amavasya) effects is quite interesting which is mentioned in the Matsya Puran.
The moon God, Som Dev was married to the twenty seven daughters (the twenty seven nakshatras) of Daksha Prajapati, one of the Prajapatis and the son of Brahma ji, who was the representation of Brahma in the world. However, Som Dev was more attracted to his last wife, Rohini and neglected his other wives for the beauty and shine of Rohini. Hurt by the negligence of their husband, the daughters approach Daksh for a solution. But, instead of giving them a solution, in his haughtiness, Daksh curses Som Dev to diminish and lose his radiance and glow.
Som Dev was perturbed by this curse and requested Daksh to take back the curse But Daksh doesn’t pay heed to his pleas. Slowly he starts losing all his glow and light, and nights became dark and lifeless. The life on Earth started to suffer because of moon’s absence. Disappointed and dejected, Som Dev approaches Brahma ji for a solution. Brahma Ji asks Som dev to observe penance about Bhagwan Shiv and get relief from the curse. Som Dev agrees and comes down to Earth at the holy confluence of rivers of Kapila, Hiran and Saraswathi joined together. He prepared a Shiv ling and started his penance with complete devotion and fervour on Bhagwan Shiv.
Pleased with the devotion of Som Dev, Bhagwan Shiv appears in front of Som Dev and asks him a boon. Som Dev requests him to relive him of the curse. Bhagwan Shiv says that he could not remove the curse but instead granted him the boon of waxing and waning every fortnight. With this, Som Dev would shine brightly before losing his glow, until he disappeared and then again start to glow day by day till he glowed in the brightest of the radiance. The day he glowed in the brightest was Poornima and the day he disappeared was the Amavasya. To completely ward of the extinction of Som Dev, Bhagwan Shiv then placed him on his head, thus becoming Chandrasekhar as the one who adorns the moon.
Thus, the Moon god was saved from total extinction by the benevolence of Bhagwan Shiv. The place Som Dev observed penance for Bhagwan Shiv came to be known as the Prabhas Tirth meaning well- lit place. The Shiv ling with all the radiance of Som Deva came to be one of the divine Jyothirlingas and the temple was built for Bhagwan Shiv which is the popular Somnath temple, the prominent Jyothirling Kshetra of Bhagwan Shiv.