On the other hand, Rangda is Barong's opposite. While Barong represent good, Rangda represent evil. Rangda is known as a demon queen, the incarnation of Calon Arang, the legendary witch that wrecking havoc in ancient Java during the reign of Airlangga in 10th century. It is said that Calon Arang was a widow, powerful in black magic, who often damaged farmer's crops and caused disease to come. She had a girl, named Ratna Manggali, who, though beautiful, could not get a husband because people were afraid of her mother. Because of the difficulties faced by her daughter, Calon Arang was angry and she intended to take revenge by kidnapping a young girl. She brought the girl to a temple to be sacrificed to the goddess Durga. The next day, a great flood engulfed the village and many people died. Disease also appeared.
King Airlangga, who had heard of this matter, then asked for his advisor, Empu Bharada, to deal with this problem. Empu Bharada then sent his disciple, Empu Bahula, to be married to Ratna. Both were married with a huge feast that lasted seven days and seven nights, and the situation returned to normal. Calon Arang had a book that contained magic incantations. One day, this book was found by Empu Bahula, who turned it over to Empu Bharada. As soon as Calon Arang knew that the book had been stolen, she became angry and decided to fight Empu Bharada. Without the help of Durga, Calon Arang was defeated. Since she was defeated, the village was safe from the threat of Calon Arang's black magic.Another version holds that Rangda was actually linked to historical queen Mahendradatta or Gunapriyadharmapatni, a Javanese princess sister of Dharmawangsa of East Javanese Isyana Dynasty of late Medang Kingdom period. She was the queen consort of Balinese king Udayana and Airlangga's own mother. Mahendradatta is known for her devotion to the cult of Durga in Bali. The story goes that Mahendradatta, the mother of Airlangga, was condemned by Airlangga's father because she practiced black magic. After she became a widow (Rangda in old Javanese means: 'widow'), hurt and humiliated, she sought revenge upon her ex-husband's court and whole of his kingdom. She summoned all the evil spirits in the jungle, the leyaks and the demons that caused plague and death in the kingdom. Airlangga face his own mother to save the kingdom. A fight occurred, but she and her black magic troops were so powerful that Airlangga had to ask for the help of spirit king, Barong in order to defeat her. Barong came with Airlangga's soldiers, and the fight ensued. Rangda cast a spell that made Airlangga soldiers all want to kill themselves, pointing their poisoned keris into their own stomachs and chests. In response, Barong cast a spell which caused the soldiers body's to be resistant to the sharp keris. At the end, Barong won, and Rangda ran away.