The Ramayana’s account of Vishvamitra, the king who gave up a kingdom to become a sage, and the tradition that links him to the Gayatri verse.
The story
Tradition names Vishvamitra as the seer of the Gayatri verse (Rigveda 3.62.10), and of most of the hymns in the third book of the Rigveda, which are credited to him and his family. The Ramayana tells how he came to be a sage.
In the Ramayana’s account, Vishvamitra was first a king, Kaushika. Once, while out with his army, he came to the hermitage of the sage Vasishtha, who welcomed him and fed the whole army from what Kamadhenu, his divine cow, provided. The king admired the cow so much that he offered Vasishtha great wealth in exchange for her. Vasishtha refused, since she was needed for the daily rites.
Vishvamitra tried to take her by force. From the cow came armies of warriors that destroyed his soldiers, and then his sons. Defeated, the king understood that the power of a sage’s austerity was greater than the power of arms. He gave his kingdom to one of his surviving sons and went away to practise tapas.
The Ramayana does not make the path easy. He practised for a long time, and was held back more than once by anger and by temptation. In the account, Brahma at last recognised him as a rajarshi, a royal sage, and after further austerities as a brahmarshi, a seer of the highest rank. Vasishtha himself accepted him as one.
Later tradition connects this long discipline with the Gayatri, which Vishvamitra is said to have seen through his practice. The Rigveda itself only names him as the seer of the hymn. The link between the story and the verse is a matter of tradition.
What the story teaches
The story is often told to show that a person’s standing comes from discipline and learning rather than from birth or power, and that the strength that fails in a contest of arms can be turned toward study.
Like every story here, it is a traditional narrative. It does not promise any result to the reader.
Source
Valmiki Ramayana, Bala Kanda (the account of Vishvamitra). The attribution of Rigveda 3.62.10 and of Mandala 3 to Vishvamitra Gathina follows the Rigveda’s own tradition of seers.
Vishvamitra’s story is told in several texts, with differing details. This retelling follows the Ramayana, condenses it, and leaves out the episodes of Trishanku and Menaka.