I have heard something about Rantideva that he was a king but I don't know the full story of King Rantideva.
Can you help me with the story related to the King Rantideva?
The name Rantideva brings back memories of reading Amar Chitra Kathas! See this excerpt from the Amar Chitra Katha comic book "Tales of Vishnu".
Rantideva was a king of the Bharata dynasty. He was a descendant of the sage Bharadvaja, who was originally the son of Brihaspati guru of the gods but was later adopted by the king Bharata, whom India is named after. Here is how the Srimad Bhagavatam describes Rantideva's lineage:
The son of Vitatha [Bharadwaja] was Manyu, and from Manyu came five sons — Bṛhatkṣatra, Jaya, Mahāvīrya, Nara and Garga. Of these five, the one known as Nara had a son named Saṅkṛti.... Saṅkṛti had two sons, named Guru and Rantideva. Rantideva is famous in both this world and the next, for he is glorified not only in human society but also in the society of the demigods.
Rantideva was a great king and a pious devotee of Vishnu. He once did such a great Yagna (fire-ritual) that the blood from the sacrificed cattle formed a river, the Charmanvati (the modern-day Chambal river), as described in the Drona Parva of the Mahabharata:
The king gave away unto the Brahmanas his wealth acquired by righteous means. Having studied the Vedas, he subjugated his foes in fair fight. Of rigid vows and always engaged in due performance of sacrifices, countless animals, desirous of going to heaven, used to come to him of their own accord. So large was the number of animals sacrificed in the Agnihotra of that king that the secretions flowing from his kitchen from the heaps of skins deposited there caused a veritable river which from this circumstance, came to be called the Charmanwati.
Later his kingdom suffered famine and drought, so he gave away all his possessions to feed his subjects, and then he went to the forest to engage in fasting.
But it's not his magnanimous deeds as king that Rantideva is known for, but rather his devotion to Vishnu. The gods once went to Vishnu and asked him who his greatest devotee was. Vishnu said that it was Rantideva, and the gods were shocked that a king could be such a great devotee. At the time Rantideva had fasted for 48 days, and he was just about to break his fast. So the gods took the form as various people and asked him for his food. The Srimad Bhagavatam describes what happened next:
Rantideva never endeavored to earn anything. He would enjoy whatever he got by the arrangement of providence, but when guests came he would give them everything. Thus he underwent considerable suffering, along with the members of his family. Indeed, he and his family members shivered for want of food and water, yet Rantideva always remained sober.
Once, after fasting for forty-eight days, in the morning Rantideva received some water and some foodstuffs made with milk and ghee, but when he and his family were about to eat, a brāhmaṇa guest arrived. Because Rantideva perceived the presence of the Supreme Godhead everywhere, and in every living entity, he received the guest with faith and respect and gave him a share of the food. The brāhmaṇa guest ate his share and then went away.
Thereafter, having divided the remaining food with his relatives, Rantideva was just about to eat his own share when a śūdra guest arrived. Seeing the śūdra in relationship with the Supreme Personality of Godhead, King Rantideva gave him also a share of the food. When the śūdra went away, another guest arrived, surrounded by dogs, and said, “O King, I and my company of dogs are very hungry. Please give us something to eat.” With great respect, King Rantideva offered the balance of the food to the dogs and the master of the dogs, who had come as guests. The King offered them all respects and obeisances.
Thereafter, only the drinking water remained, and there was only enough to satisfy one person, but when the King was just about to drink it, a caṇḍāla appeared and said, “O King, although I am lowborn, kindly give me some drinking water.” Aggrieved at hearing the pitiable words of the poor fatigued caṇḍāla, Mahārāja Rantideva spoke the following nectarean words. I do not pray to the Supreme Personality of Godhead for the eight perfections of mystic yoga, nor for salvation from repeated birth and death. I want only to stay among all the living entities and suffer all distresses on their behalf, so that they may be freed from suffering. By offering my water to maintain the life of this poor caṇḍāla, who is struggling to live, I have been freed from all hunger, thirst, fatigue, trembling of the body, moroseness, distress, lamentation and illusion." Having spoken thus, King Rantideva, although on the verge of death because of thirst, gave his own portion of water to the caṇḍāla without hesitation, for the King was naturally very kind and sober.
Demigods like Lord Brahmā and Lord Śiva, who can satisfy all materially ambitious men by giving them the rewards they desire, then manifested their own identities before King Rantideva, for it was they who had presented themselves as the brāhmaṇa, śūdra, caṇḍāla and so on. King Rantideva had no ambition to enjoy material benefits from the demigods. He offered them obeisances, but because he was factually attached to Lord Viṣṇu, Vāsudeva, the Supreme Personality of Godhead, he fixed his mind at Lord Viṣṇu’s lotus feet.... [B]ecause King Rantideva was a pure devotee, always [fixing his mind on Vishnu] and free from all material desires, the Lord’s illusory energy, māyā, could not exhibit herself before him. On the contrary, for him māyā entirely vanished, exactly like a dream.
So finally, after passing the test of the gods, Rantideva was granted Moksha by Vishnu.