Thunderbolt, or Vajra, is the weapon associated with Indra, the king of the Devas. There is an interesting story in the Puranas that narrates how Indra got the weapon thunderbolt. The story begins with Namuchi, the demon of darkness, removing light from earth and another demon named Vritra removing moisture from earth and thus making earth dry.
Due to the activities of Namuchi and Vritra, the earth became barren and living beings began to die.
Indra tried to subdue the demons but he failed in all his attempts as the demons had got the boon that they can only be killed by weapon that which is neither solid nor liquid.
Indra then approached Srihari Vishnu for a solution. Vishnu then collected foam from the milky ocean and made from it Vajra – a weapon that send out thunderbolts.
Indra used the weapon to annihilate Namuchi and Vritra. He then destroyed their palaces and brought back light and moisture to earth. Thus saving the living beings on earth.