The Hindu myth has its origins in the famous episode of samudra manthan. As per the myth, the gods and asuras got together to churn the ocean to get the wealth from the bottom of the sea. Amongst this wealth, the most coveted and awaited of all was the amrita (nectar of life) consuming of which would grant immortality. Both the gods and the asuras were after it, but both knew that they needed each others might to churn it out of the sea.
When they finally got the nectar, Lord Vishnu took the form of Mohini, the enchantress and asked all of them to stand in a queue and she would serve it to one and all, with the idea of not serving it to the asuras at all. All the asuras were too enchanted to see thru the deception, except for one of them, by the name of Swarbhanu. Swarbhanu could sense something amiss and so he disguised himself like the gods and managed to get a sip.
Rahu and Ketu came to dislike Sun and Moon, and so once in a while they try to swallow them. Since there is no body, every time the mouth (Rahu) swallows the Sun or the Moon, it slips out of the tail (Ketu). During the time that the Sun and the Moon pass thru Rahu and Ketu, there is darkness all around. This is the mythical reason of a Solar eclipse and a Lunar eclipse!
Rahu and Ketu have a lot of astrological significance (negative impact) on the mortals, which is a different subject altogether.
The picture shows Rahu swallowing the Sun and causing an eclipse. This
Rahu Temple (Named Wat Srisathong) is in Nakhon Chaisi 65 kms from . Bangkok