Baidyanath dham is one of the twelve Jyotirlingas, the most sacred abodes of Shiva. It is located in Deoghar in Jharkhand, India. The temple complex comprises of the main temple and 21 other temples.
According to Hindu beliefs, the demon king Ravana worshipped Shiva at the current site of the temple to get the boons that he later used to wreak havoc in the world. Ravana offered his ten heads one after the another to Shiva as a sacrifice. Pleased with this, Shiva descended to cure Ravana who was injured. As he acted as a doctor, he is referred to as Vaidhya (“doctor”). From this aspect of Shiva, the temple derives its name.
Acording to the Shiv Purana, Ravana felt that his capital would be perfect and safe only if Shiv resided there. As a result, he began praying to the Lord. Impressed by his devotion, Lord Shiva gave Ravana a Shiva Lingam and told him to take it with him to Lanka. However, if on the way, Ravana were to stop anywhere and put the lingam down, it would get fixed permanently on that spot. Ravana was immensely happy as the lingam would protect his capital and decided to not put the lingam down anywhere.However, the other gods objected as if Ravana were to get the lingam in Lanka, he would turn invincible and would be able to wreck havoc in the world.
On his way back from Mount Kailash, Ravana needed to perform the sandya-vandana which he could not do with the lingam in one hand. He started searching for someone nearby who could hold the lingam for him. Ganesh appeared, disguised as a shepherd, and offered to hold the lingam. He however warned Ravana that if the latter took a large amount of time in getting back, he would leave the lingam on the ground and leave. Ravana agreed and left for his sandya-vandana. Ganesh pretended to be vexed by his delay in returning and left the lingam on the ground. When Ravan returned, he saw the lingam on the ground and despite his best efforts, he was unable to move it again. He left for Lanka without the lingam. The gods were happy that the Shiva linga did not reach Lanka and Ravana was unable to destroy the world