The legends about this Shiva temple are various. One legend is that in the Treta Yuga the demon Ravana, king of Lanka , propitiated Lord Mahadeva and wanted him to come over to Lanka. Mahadeva did not agree to this prayer but told Ravana that one of the twelve emblems of His divinity. Jyotirlinga, would be quite as effective as His presence and that he might take it away on the condition that there should be no break in the journey and the lingam would not be deposited anywhere on the earth. The condition was that if the lingam was put anywhere on the earth in the course of the journey, it would be fixed to that spot for ever. The legend is that Ravana agreed to this condition and took the lingam and started his journey back to Lanka. The gods dreaded the effect of the lingam being established at the seat of the demon king. A ruse was devised and Varuna, the god of the waters, entered the stomach of Ravana and the demon had to descend to earth to relieve himself. Later, Vishnu, in the garb of an old Brahmin, appeared before Ravana, after his descent to the earth, and began to converse with him. Ravana requested the Brahmin to kindly hold the Jyotirlinga for a few minutes so that he could relieve himself.
Lord Vishnu readily agreed to it and, as soon as Ravana turned his back to relieve himself, he left the Jyotirlinga on the spot and vanished. When Ravana came back, he found that the Jyotirlinga was firmly fixed to the earth and realised that a trick had been played on him. He even tried violence to remove the lingam and thereby broke a piece off the top of the lingam. However, failing to remove the lingam, he made his obeisance to the lingam and daily worshipped it. The spot where Ravana came down to the earth has been identified with Harlajuri, about four miles north of Deoghar and the place where the lingam was deposited is known as Deoghar.
The present nomenclature, of the lingam is Baidyanath and there is a legend about it. According to the Padma Purana, a Brahmin in the garb of Lord Vishnu, after taking the lingam from Ravana, consecrated it in due form with water from a neighbouring tank. There was a Bhil present, who was instructed as to what should be clone. The Bhil had informed Ravana as to the disappearance of the Brahmin. Ravana is supposed to have excavated a well with an arrow and brought into it the waters of all the sacred pools of the earth. It is said that the lingam, after the death of Ravana, used to be worshipped by a hunter Baiju, and the lingam came to be known by Baijus name as Baidyanath. The story of Baiju giving rise to the name of Baidyanath is more prevalent as a Santhal tradition. There is another legend to the effect that when Sati, the consort of Shiva and daughter of Daksha, committed suicide because of the discourtesy shown towards her husband by Daksha in not inviting him to a Yajna, Lord Shiva stuck the corpse of his wife on the point of his trident and roamed about in a frenzy of fury. Lest Shivas anger and frantic movements should destroy the world, Vishnu cut the dead body with his discus into fifty-two parts which fell in different parts of India and became Mahapithasthans. According to the legend, the heart of Sati fell at Deoghar. It is, however, peculiar that there is no shrine at the other fifty-one places to commemorate this occurrence.