Harihara is the fused representation of Vishnu (Hari) and Shiva (Hara) from the Hindu tradition. Also known as Shankaranarayana ("Shankara" is Shiva, and "Narayana" is Vishnu), Harihara is thus revered by both Vaishnavites and Shaivites as a form of the Supreme God.
As per Hindu legend, Sage Kalava was suffering from serious ailments along with leprosy. He prayed to the Navagrahas, the nine planet deities. The planets were pleased by his devotion and offered cure to the sage. Brahma, the Hindu god of creation, was angered as he felt that the planets have no powers to provide boons to humans. He cursed the nine planets to suffer from leprosy and were sent down to earth in Vellurukku Vanam, the white wild flower jungle - the modern time Suryanar Kovil. The planets prayed to Shiva to relieve them off the curse. Shiva appeared to them and said that the place belonged to them and they would have to grace the devotees worshipping them from the place. Each temple is located in a different village, and is considered an abode of one of the Navagrahas. However, the majority of these temples are dedicated to Shiva. The Surya temple is the only one dedicated to the Graham. In fact, it is dedicated entirely to the worship of the Sun-God and the other navagrahas, the former being the object of worship as the principal deity and the latter as attendant deities. It was built around the 11th or 12th century C.E. The other temples were built earlier, ranging back to 7th-9th century.