There is a story behind the fame of Vaidyanathan which unfolds as follows : This tells of the evil demon lord from the pages of the holy Ramayan, the devouted King Ravana of the kingdom of Sri Lanka ( once known as Ceylon ) who had gone into very severe meditation so as to invoke Lord Shiva, and in doing so he had placed a request before God to come and visit Sri Lanka, so as his capital may become invincible.
Ravana is said to have even made an attempt to lift Mount Kailash, the holy mountain, which is Lord Shiva's abode, and carry it with him to his capital; but Lord Shiva immediately pulverized him with the force of just his finger, and Ravana prayed to him for the Lord's mercy, after which Shiva gave him one of the twelve
Jyotirlingams on the condition that if ever Ravana was to place it on the ground it would take root immediately and hence Ravana had to carry it back inone go on his trip back to his capital. However, this was not to be since Varuna the God of water entered Ravana's stomach belly, and caused him to feel the need to relieve himself.
Vishnu then came down in the form of a lad and volunteered to hold the Jyotirlingam as he relieved himself. But before Ravana could return, the young lad placed the jyotirlingam on the ground to which it became rooted. A disappointed Ravana offered severe penances to Shiva here, and cut off nine of his heads as a part of his repentance. Shiva revived him and joined the heads to the body, like a Vaidya or a physician, hence this Jyotirlingam goes by the name Vaidyanath. The same legend holds at Gokarnam in Karnataka.