Devayani, the daughter of Shukracharya, the guru of the asuras, and Sharmishtha, the daughter of King Vrishaparva, were close friends. One day, they went to a park and enjoyed bathing in a lake. After their bath, Sharmishtha by mistake put on Devayani's sari. Devayani felt very offended and insulted the princess. She said, "Like a dog eating up the offerings meant for a yajna, you have put on my sari!" Sharmishtha got very angry, pushed Devayani into a well after insulting her and her father, and then went back to the palace.
At that time, King Yayati was hunting in that park. He happened to come close by the well in which Devayani was trapped and heard her wails. He rushed to the helpless girl's rescue and pulled her out of the well. Gradually, they became enchanted with each other, and Yayati promised to marry Devayani. He then took leave of her.
When Devayani went to her father and told him what Sharmishta had said and done, Shukracharya was disheartened and decided they should leave the kingdom. But when King Vrishaparva heard about it, he came, fell at the preceptor's feet, and begged his forgiveness. The demon guru said: "I can forgive you, but you have to fulfil the wishes of Devayani." Then Devayani said, "Wherever I go after my father gives me in marriage, Sharmishtha will have to accompany me as my maidservant, along with her attendants." As King Vrishaparva was worried about what would happen to his kingdom if Shukracharya left, he agreed.
According to Devayani's wish, Shukracharya married her to King Yayati, and as per the agreement with King Vrishaparva, Sharmishtha accompanied her to her husband's place as her maidservant. Before they left, Shukracharya commanded Yayati, "You must never share a bed with Sharmishtha."
After some time, Devayani gave birth to a boy. But Sharmishtha was deprived of the pleasure of having a child, so she begged King Yayati to fulfil her desire. Although Shukracharya had forbidden Yayati from having any relationship with Sharmishtha, fate decreed otherwise. The king felt compelled to fulfil Sharmishtha's wish. As time went by, Sharmishtha became the mother of three sons.
Eventually, Devayani learned that Sharmishta had children by Yayati, and she became very angry. She left her husband to return to her father's place. Yayati, however, was very much in love with Devayani and began to pursue her. "How can I live without her?" he wondered. He earnestly begged her not to go, entreating her as they went, but he was unable to persuade her. Finally, both of them arrived at Shukracharya's place.
Shukracharya had been apprehensive of this. Greatly distressed at the turn of events, he cursed his son-in-law, saying: "You unfaithful creature! You have defied my order! You will lose your youthful vigour and become a doddering old man!" When King Yayati begged for forgiveness, Shukracharya cooled down a little and amended his curse, saying, "Well, if any young man is willing to accept your old age, then you may exchange your old age for his youth."
King Yayati thus became a doddering old man, but he still hankered for earthly pleasures. He then approached his eldest son, Yadu, and asked him to accept his old age. But what normal person would give up earthly pleasures without first enjoying them? Yadu did not agree. Yayati then asked his other sons in turn, but they also declined their father's request. Finally, he asked his youngest son, Puru. Puru said, "I am indeed fortunate to get this rare chance to make adequate recompense to my father, who has given birth to my body. By pleasing him, I shall earn the greatest good." So Puru accepted the old age of his father, while Yayati received the full vigour of his son's youth.
With his regained youth, Yayati enjoyed the pleasures of life to his heart’s content for a thousand years. But his desire for enjoyment did not come to an end. On the contrary, it was increasing every day. But finally, realization dawned on Yayati, and he said to himself, "I have enjoyed all the pleasures of the world, but they have not brought me lasting happiness. I have wasted my youth in pursuit of fleeting pleasures. Now, I am old and tired, and my time is running out. I must seek the path of spirituality."
Yayati then retired to the forest and spent the rest of his days in meditation and penance. He realized that true happiness lies not in the pleasures of the world but in the realization of the self. He attained enlightenment and became a great sage.
In the end, Yayati's story teaches us that worldly pleasures are fleeting and temporary. They cannot bring lasting happiness. True happiness lies in the realization of the self and the attainment of spiritual knowledge.