Sandhya was very ashamed of herself. For the atonement of her sin she decided to do penance. She went to Chandrabhaga mountain and commenced her tremendous penance.
Lord Brahma then instructed Vashishtha to go to her in disguise and help in getting her initiated. He went to Chandrabhaga mountain in the guise of a brahmin and gave the mantra – OM NAMAH SHANKARAYA OM to her and also told her the methods of doing worship, then he returned back.
After sage Vashishtha who was disguised as brahmin went away. Sandhaya did penance as per his instructions. After the passing of one Chaturyuga, she had a darshan of lord Shiva.
Shiva being pleased by her devotion asked her to demand anything. Sandhya said-
“Nobody should have lust towards the member of his own clan. There should be no virtuous and chaste woman greater then me in this whole world. Anybody other than my husband who looks at me with evil intentions become an impotent man.”
Lord Shiva blessed her by saying- ‘Evamastu!’
Lord Shiva then categorised the life-span of a man into four parts – childhood, adolescence, youth and old age. He than told her that it was written in her destiny to die by burning. He also advised her to go and surrender her body in the sacrificial fire of the yagya, performed by Medhatithi. “Before jumping into the sacrificial fire, just remember anybody, whom you want as your husband, and your wish would be fulfilled in your next birth, when you would take birth as a daughter of Daksha Prajapati. Your father Daksha Prajapati would marry his 27 twenty daughter to Moon, but the moon would have affection only towards Rohini and rest of his wives would be neglected by him. For this reason he would be cursed by Daksha. All the deities would take your refuge.”
After blessing Sandhya in the way lord Shiva went back to Kailash mountain.