Ghanta and Karna were brothers in some sources, but the older rakshasa was called by both names, Ghantakanta, as the myths were about him. Ghanta’s myth was nested within several others and modified in sectarian versions competing over who was the supreme deity, Siva or Vishnu.
Ghantakarna came into being because Siva had to create a terrible demon to correct a misuse of a boon that he had granted to Mandodari, wife of a demon named Daruka. The story goes like this: Daruka had done austerities (tapas) in order to gain a boon from Brahma and then used it to make life miserable for the devas (gods). They in turn sought relief from Siva, who created Bhadrakali from his third eye. Bhadrakali killed Daruka and left his wife Mandodari grieving. Mandodari then did severe tapas and won a gift from Siva, some drops of sweat from his body. Siva told her that these drops would cause smallpox to anyone upon whom they were sprinkled. So of course the demoness Mandodari, as goddess of smallpox, made her first victim Bhadrakali. As Bhadrakali suffered from a life-threatening case of smallpox, (Siva created the rakshasa Ghantakarna to help her. Ghantakarna had the power (sakti) to lick the smallpox from her body. However, Bhadrakali stopped him before he licked her face, pointing out that Ghantakarna and she were brother and sister, since both were from Siva, and it would be wrong for Ghantakarna to lick the face of his sister.
Ghantakarna at first took Vishnu to be his enemy. He put bells (ghanta) in his ears (karnas) to prevent hearing any mention of Vishnu. However, Siva instructed Ghantakarna that Vishnu was greater than he ((Siva). So Ghantakarna became a devotee of Vishnu and sought to obtain salvation from him. One day Shri Krishna was meditating at a hermitage called Badarya-asirama and heard the sounds of Pisacas, hungry souls of the dead, and their hunting dogs. They were led by Ghantakarna, who was reciting the name of Vishnu (a practice called japa). Krishna blessed him and appeared as Visivarupa, the all embracing form of the supreme lord of the universe. At once Ghantakarna brought the best offering a rakshasa knew to give, a dead corpse of a brahmin. Krishna looked past the gift into the heart of this demon and touched his body. Immediately the demon lost his form and entered Vaikuntha, Vishnu’s paradise.
Ghantakarna’s image with eighteen hands is worshipped in Vaishnava temples as the god who cures diseases that result from one’s own sins. Ghantakarna was the rakshasa who became a deva.