Mike Crowley has given a good account of a Buddhist story which is very similar to the story in Hindu Puranas. I wrote about Rahu and Kethu in an article recently and this story relates to that very vividly:
Once upon a time the Buddhas all met together on the top of Mount Meru, to deliberate upon the means of procuring the water of life, Dutsi, which lies concealed at the bottom of the deep ocean. In their benevolence, they intended, as soon as they obtained the water of life, to distribute it amongst the human race as a powerful antidote against the strong poison Hala, which the evil demons, at this period, had been using with such mischievous effect against mankind.In order to procure the antidote they determined to churn the ocean with the mountain Meru, and so cause the water of life to rise to the surface of the sea. This they did, and delivered the water of life to Vajrapani, with orders to secure it safely until a future meeting, when they would impart it to living beings. But the monster Rahu, a Lhamayin, happened to hear of this precious discovery, and having carefully watched Vajrapani's movements, seized an opportunity, in the absence of the latter, to drink the water of life; not satisfied with this act, he even voided his water deliberately into the vessel. He then hurried away as fast as possible, and had already proceeded a great distance, when Vajrapani came home, and having perceived the theft, instantly set out in pursuit of the culprit.
In the course of his flight Rahu had passed the sun and moon, whom he menaced with vengeance, should they venture to betray him to Vajrapani. His searches proving fruitless, Vajrapani betook himself to the sun, and asked him about Rahu. But the sun replied evasively, saying that he had certainly seen somebody passing a long time ago, but had paid no particular attention as to who it was. The moon, on the other hand, returned a candid answer, only requesting that Vajrapani would not repeat it before Rahu. Upon this information Rahu was shortly afterwards overtaken, when he got such a terrible blow from Vajrapani's scepter [i.e. vajra] that, besides receiving many wounds, his body was split in two parts, the lower part of the body with the legs being entirely blown off.[Note: This might be interpreted as a reason why Sun is considered as a malefic and Moon is considered as a benefic generally.]
[Note: This is a hint for psychoactive herbs like Amanita Muscaria.]
The Buddhas once more held a meeting, in which they deliberated upon the best means of disposing of Rahu's urine. To pour it out would have been most dangerous to human beings, as it contained a large quantity of the poison Hala hala; they therefore determined that Vajrapani should drink it, in just punishment for the carelessness through which the water of life was lost. Accordingly he was forced to do so, when his fair, yellow complexion was changed by the effects of this potion into a dark one. Vajrapani conceived, from his transfiguration, a most violent rage against all evil demons, and in particular against Rahu, who, notwithstanding his deadly wounds, was prevented from dying by the water of life. This powerful water, however, dropped from his wounds and fell all over the world, numerous medicinal herbs springing up on the spots where it touched the soil.
A severe punishment was also inflicted upon Rahu by the Buddhas themselves; they made a horrible monster of him, replaced his legs by the tail of a dragon, formed nine different heads from his broken one, the principal wounds were made into an enormous throat, and the lesser ones into so many eyes. Rahu, who had ever distinguished himself from his fellow-beings by his wickedness - in their earliest youth even the other gods had to suffer from his malignity - became, after this transformation, more dreadful than he was before.His rage was turned especially towards the sun and the moon, who had betrayed him. He is constantly trying to devour them, particularly the moon, who displayed the most hostile disposition towards him. He overshadows them whilst trying to devour them, and thus causes eclipses; but owing to Vajrapani's unceasing vigilance, he cannot succeed in destroying them.