One of the names of Lord Shiva is Chandrashekhara. He got this name after he gave refuge to Moon or Chandra on this matted locks after Chandra was cursed by Daksha Prajapati.
Legend has it that Daksha Prajapati, one of the creator-gods and manas-putra ofLord Brahma, married twenty seven of his daughters – the Nakshatras or constellations, to Chandra – the moon god. But Chandra was attracted by the beauty of only Rohini nakshatra and was therefore partial to her.
The other disappointed daughters complained to Daksha about Chandra’s favouritism for Rohini. This behavior of the moon god angered Daskha. He cursed Chandra that his body of which he is so proud will fade away.
Soon the body of Chandra started fading away and this caused upheaval on earth. Several plants and herbs that needed moonlight to survive began to wither. Chandra then approached Lord Vishnu who directed him to Lord Shiva who is the supreme physician and the keeper of the sacred herb Soma.
Left with only one part of his form, (Kala), Chandra approached Shiva. Lord Shiva helped Chandra in regaining his lost lustre and glory with the herb Soma. But Daksha cursed him again and he again took the help of Lord Shiva and this continued for a long period. Finally, Shiva asked Chandra to take refuge in the matted hair on his head where he would find enough soma to keep him rejuvenated.
Thus the curse of Daksha causes the moon to wane; the moon waxes again as Lord Shiva rejuvenates him.
Since Shiva gave refuge to Chandra, he came to be known as Chandrashekhara.
Chandrashekara is one of the pleasant forms of Shiva and in this form he is believed to cure ailments and helps in fulfilling the wishes of his devotees.
Om Namoh Shivaya!
(The crescent moon rises in Bhubaneswar this evening as the clouds float away.)