Initially, at some stage,the gods and the demons were engaged in a great war over a very long period. Lord Visnu persuaded both the gods and demons for a temporary peace so that the ocean in its entirety could be churned and both devas and the asuras could benefit from what the sea had to offer. The gods under the leadership of Indra grabbed the tail of the king of snakes, Vasuki, who was used as a rope for churning the ocean, while the demons under the leadership of Vali held the mouth of Vasuki. The great mountain Mandara acted as the churner. As a result of this churning, the first to come out was the terrible poison, halahala. It was voluntarily sucked in by the Lord Siva, but he held it in his throat, the reason why Siva is also known as Nilakantha. Then out came Surabhi, Kaustubha, Parijata, Laksmi, the Moon, Varuni (the goddess of wine). And finally emerged Dhanvanatari, the originator of medicine, with a pot of amritam, the nectar. The demons ran away with the pot. Lord Visnu acting in the interest of the gods transformed himself into Mohini, a beautiful woman. Dazzled by her beauty, the demons offered the pot to Mohini and asked her to distribute the nectar amongst themselves as she was found to be an appropriate person. Of course, she gave all the nectar to the gods. One of the demons, Rahu, saw through the trick and sat in the line in disguise, where the nectar was being distributed. But before he could swallow the divine nectar, the Sun and the Moon detected his masquerade and reported it to Lord Visnu, who then chopped off Rahu's head with his sudarsan cakra. Because Rahu had already drunk the nectar, he remained alive in spite of his being reduced to a trunkless body. Since then Rahu has not forgiven the Sun and the Moon. And this is the reason why, as has been depicted in the style of Pauranik description, every once in a while Rahu gobbles up the Sun or the Moon and we witness the solar and the lunar eclipses. Of course, being trunkless he cannot hold either the Sun or the Moon for long, and they come out safely after a while. With time the headless trunk of the demon came to be known as Ketu, and the earlier version of Ketu gracefully turned into what is known as Dhumketu.