In Hindu mythology, it is referenced that, Great sage, Durvasa Muni, once cursed Indra saying that he and the other gods would lose all their powers. In due course, Indra and the other gods began losing all battles against the demons, and the demons led by Bali took control of the universe.
Seeing no other means, the helpless Indra rushed to Vishnu for help.
Lord Vishnu said that to get back their powers the gods they would have to churn the oceans and bring out the magical nectar-amrita. Only after consuming it could they regain their powers. This great churning is known as samudra manthan.
The gods and demons got together for the the herculean task. The huge mountain, Mandara, was used as the pole to stir the waters. But as the pole entered the water it kept sliding into depths of the ocean. To stop this, Vishnu quickly transformed himself into a tortoise and placed the mountain on his back. In the event Lord Vishnu took his second avatar called ‘Kurma’ or Tortoise.
When the gods and demons were churning the ocean (samudra manthan), poison came out in the month of Shravan. As with all gifts from the ocean, this too had to be accepted, though none wanted to. Lord Shiva consumed the poison – even though he was not a part of the churning – to help out the gods and held it in his throat, which turned it blue. To douse the poison’s effect, the grateful gods offered water, and devotees today too offer water to the Shivlinga with the same belief.