The souls of the sons of Sagara wandered as ghosts since their final rites had not been performed. For the moksha of all the sons of Sagar, Bhagiratha (Means, one who does great hard work- he got his name from his great hard work for bringing Ganga to earth), one of the descendants of Sagar, vowed to bring Ganga down to Earth so that her waters could cleanse their souls and release them to heaven.
Bhagiratha prayed to Brahma that Ganga come down to Earth. Brahma ordered Ganga to go down to the Earth and then on to the nether regions so that the souls of Bhagiratha's ancestors would be able to go to heaven. Ganga felt that this was insulting and decided to sweep the whole Earth away as she fell from the heavens. Alarmed, Bhagiratha prayed to Shiva that he break up Ganga's descent.
Ganga arrogantly fell on Shiva's head. But Shiva calmly trapped her in his matted hair and let her out in small streams. The touch of Shiva further sanctified Ganga. As Ganga travelled to the nether-worlds, she created a different stream to remain on Earth to help purify unfortunate souls there. She is the only river to follow from all the three worlds – Swarga (heaven), Prithvi (Earth) and Patala (netherworld or hell). Thus is called Tripathagā(one who travels the three worlds) in Sanskrit language.
Because of Bhagiratha's efforts, Ganga descended to Earth and hence the river is also known as Bhagirathi and the term Bhagirath prayatna is used to describe valiant efforts or difficult achievements.
It is sometimes believed that the river will finally dry up at the end of Kali Yuga, the last of the four stages the world goes through as part of the cycle of yugas (the era of darkness, the current era) just as with the Sarasvati river and this era will end. Next in(cyclic) order will be the Satya Yuga or the era of Truth.