The story of Suryavansh is mentioned in Vishnu Purana. This story begins with King Sagar..
King Sagar had two queens, Sumati, the daughter of Kashyapa and Keshini, the daughter of Vidarbha’s king. Keshini had a son Asmanjas whereas Sumati had sixty thousand sons. Anshuman was the son of Asmanjas. Asmanjas was very whimsical since his childhood. Even in his youth, he did not change his behaviour. Hence King Sagar had abandoned Asmanjas. But the things did not improve for Sagar because even his sixty thousand sons followed the footsteps of Asmanjas.
The gods one-day approached sage Kapila who was a partial incarnation of Lord Vishnu. Greeting him, they said- “If the sixty thousand sons of Sagar continued on their whimsical way, the earth would not remain suitable for living.” Sage Kapila assured the gods that the sixty thousand sons of Sagar would meet their fate very soon. By the instigation of sage Kapila, King Sagar organised an Ashwamedha Yagya.
The sixty thousand princes also followed the horse guarding it. But somehow Indra managed to kidnap the horse and tethered it at the hermitage of sage Kapila. The sixty thousand princes searched for the horse and following the footprints, they also reached the hermitage. There they found the horse and also a sage in deep meditation. Thinking that the sage might have been responsible for abduction of the horse they began to abuse him. As soon as sage Kapila disturbed by the abuses opened his eyes, a flame appeared and incinerated all the sixty thousand princes. When King Sagar came to know about this incident, he sent Anshuman to bring back that horse.
Anshuman also reached the hermitage and greeted sage Kapila with respect. Pleased by his politeness, sage Kapila blessed Anshuman and instructed him to take the horse away with him. He also asked him to seek a boon. As the boon, Anshuman only sought the salvation for his sixty thousand dead uncles. Sage Kapila assured Anshuman that his ancestors would certainly attain to the heaven but only after a long wait and that his grandson Bhagirath would bring the Ganges onto the earth and that the Ganges’ waters would wash the ashes of his ancestors to the ocean and cause their salvation.
Thus blessed by the sae Kapila, Anshuman returned to the capital with the horse in order to help his grand father finish the Yagya. Anshuman had a son Dileep. Dileep’s son was Bhagirath who observed severe penance and pleased Ganga to descend on the earth. Since the Ganges had descended on earth because of Bhagirath’s penance, she also got a name Bhagirathi.
The lineage of Bhagirath grew as follows- Bhagirath, Suhotra, Shruti, Nabhag, Ambareesh, Sindhudweep, Ayutayu, Rituparn, Sarvakam, Sudas, and Saudas.
One day, King Saudas went hunting in the forests. There he spotted a pair of the tigers. They were actually a tiger and a tigress in mating. Saudas killed one of them by his arrow, while the other turned into a demon and threatening of an avenge disappeared from the scene.
In due course, King Saudas organised a Yagya in the auspices of sage Vashishta. Towards the end of Yagya, sage Vashishta went away to take bath. Meanwhile the same demon arrived there in the guise of Vashishta and expressed his desire to eat non-vegetarian food. Then the demon arrived before the king in the guise of the cook. The king ordered him to cook meat for the sage. The cook cooked human flesh and served it before the sage. Sage Vashishta knew that the food contained human flesh. He cursed the king in anger to be a demon. Within three days, King Saudas became a demon and began to roam in the forests. Since then he ate the humans only.
One day, Saudas in demon form saw Muni who was in the process of mating his wife. The demon caught and ate the Muni neglecting all the cries and wailing of his wife. The Brahmani angrily cursed the demon that as her husband had been killed while he was about to sate his carnal lust similarly he would also die right in the same process.
King Saudas remained in the demon’s form for twelve more years. After that he recovered from the curse and began to rule like a pious king. One day, King Saudas saw the queen in an amorous condition and an impulse of carnal pleasure ran within his body. He made advances to satisfy his lust but the queen who knew everything about the curse stopped him reminding him of the curse. Since then the king stuck to celibacy. Since the king had no son, he allowed his queen Madayanti to conceive a child with the help of sage Vashishta. The queen did conceive but the foetus remained unborn for seven years at length. At last the irritated queen hit her foetus with a stone. This resulted in the birth of child at once. The child was named Ashmak.
The lineage of Ashmak grew as follows: Ashmak, Moolak, Dasharath, Ilivil, Vishvasah, and Khatwang. Khatwang had killed many formidable demons fighting by the side of the gods. Pleased by his gallantry, the gods wanted to grant him a boon. Khatwang wanted to know how long would live more. The gods told him that he would live for one Muhurta more. Hearing this, Khatwang came back on earth and prayed Lord Vishnu to take him in His refuge. At last he did annihilated with Lord Vishnu.
Lineage of Khatwang grew as follows-Khatwang, Deerghbahu, Raghu, Aja, and Dasharath. King Dasharath had three queens who gave birth to four sons- Rama, Lakshmana, Bharata and Shatrughana.
Rama was an incarnation of Lord Vishnu. His life too had lot of ups and downs. After being trained in archery, He and Lakshmana spent most of their boyhood time in the hermitage of sage
Vishwamitra guarding his Yagyas from the demons. After that when Vishwamitra was taking them to Mithila Lord Rama saved Ahilya who had been converted into a stone by the curse of her husband sage Gautam. In Mithila, Lord Rama broke the bow of Lord Shiva and won Sita as His wife. When they returned to Ayodhya, King Dasharath decided to crown Rama as the new king. But misguided by Manthara, queen Kaikeyee stubbornly sought that her son Bharata should be crowned as the new king whereas Rama should be sent on an exile for fourteen years. Bounded by his promises that he had made to Kaikeyee earlier, King Dasharath had no choice but to accept her demands.
Thus to keep His father’s words, Lord Rama accepted the exile. Sita and Lakshmana also followed His steps. In the forests, the demon king Ravana deceitfully abducted Sita. It was followed by meeting of Rama with Hanuman and Sugriva, killing of Bali- Sugriva’s brother, finding of Sita by Hanuman in Lanka, bridging of the sea that separated Lanka, fierce battle with the demons and ultimately killing of Ravana by Lord Rama. After the completion of exile period Lord Rama returned to Ayodhya and ruled there for twelve years.
Lord Rama had two sons- Lava and Kusha. Lineage of Kusha grew as follows- Kusha, Atithi, Nishadh, Anal, Nabh, Pundareek, Kshemdhanwa, Devaneek, Ahinaka, Ruru, Pariyatrak, Deval, Vanchal, Ulka, Vajranabha, Shankhan, Yushhitashva, Vishvasaha, Hiranyanam, Pushya, Dhruvasandhi, Sudarshan, Agnivarn, Shighrag, Maru, Prasushrut, Susandhi, Amarsh, Sahaswan and Vishvabhav. Vishvabhav had a son Brihdal who was killed by Abhimanyu in the battle of Mahabharata.