Markandeya says- ‘King Surath was the descendant of Chaitra. He was defeated in the battle against King Kolvidhvansi. All his wealth was deceitfully taken over by his cunning ministers. King Surath fled to the forest to save his life where he met a sage named Medha. He stayed with him at his hermitage but after a while, the thought of his lost kingdom began to torment him. One day, while he was roaming near the hermitage, he met a Vaishya named Samadhi. Samadhi narrated his woeful story as to how his sons had driven him out of his home after taking all his wealth. But inspite of this, his love for them remained intact. Both Surath and Samadhi went to sage Medha and told him that- ‘Inspite of our miserable condition, we are unable to understand why we still have affection and love for our near and dear ones even though they have cheated us.’ Sage Medha replied- ‘O king! Due to the illusions of this world, human beings are deeply influenced by attachments. So, there is nothing to be amazed. Goddess Mahamaya influences the mind of each human being. She does not spare even the most learned one. When she becomes pleased, she bestows liberation.’ The king asked- ‘Who is this Mahamaya? Please tell us about her.’
Sage Medha then told them about Mahamaya- ‘O king! Goddess Mahamaya is beyond the reach of origin and destruction. When the whole earth was submerged in water at the end of the Kalpa, Lord Vishnu took refuge of Yoganidra. While He was sleeping, two demons, Madhu and Kaitabh manifested from the wax of his ears. The demons wanted to attack Brahma. Lord Brahma got scared and sought help from Goddess Nidra. She manifested from the body of Lord Vishnu and appeared before Lord Brahma. Lord Vishnu woke up from his sleep. He saw that the demons were trying to kill Lord Brahma. He fought with both the demons for 5,000 years. Goddess Mahamaya influenced the demons’ minds as a result of which, they asked some boons from Lord Vishnu. Lord Vishnu granted the boons to them and said- ‘Both of you will get killed by me.’ The demons said- ‘We are ready to get killed on the condition that you kill us only in such a place where there is no water.’ As the whole earth was submerged in water, so the demons thought that Lord Vishnu would not be able to get a base to kill them. But Lord Vishnu severed their heads after making them sit on His thighs.