According to the legend, there was a demon named Tripurasura, who was a devotee of Lord Shiva. He prayed fervently to the Lord Shiva to grant him immortality. Lord Shiva pleased with this penance, granted him his wish on the condition that he will work for the welfare of the people and help them.
However Tripurasura after getting the powers started harassing the people and broke the promise made to Lord Shiva. All the other gods were perturbed by Tripurasura's behaviour and approached Lord Shiva for help. Lord Shiva attained the huge colossal form of Rudra and fought with Tripurasura, the fight ended and Tripurasura was killed.
Lord Shiva was tired after the fight and took rest in the Sahyadri mountains. As he rested his sweat started pouring and formed many small streams which collectively formed a pond. The river Bhima started from this very pond or kund. Devotees requested Lord Shiva to reside in that place forever. And Lord Shiva listened to them stayed there in form of Jyotirlinga.