I saw idols of Navagraha (nine planets) in many Shiva temples, but I haven't seen them in Vishnu temples like Krishna, Venkateshwara, or Rama. Also, Rahu and Ketu pooja is done only in some Shiva temples e.g., Srikalahasti Temple, A.P.
What's the reason for having idols of Navagrahas and pacifying Rahu and Ketu for removal of doshas by doing pujas in Shiva temples?
The nine planets are collectively known as Navagrahas. They are worshipped in Hinduism for good luck or to overcome adversity, bad luck or misfortune arising from past karmas or birth related defects (dhoshas). They are found in most Hindu temples either grouped together on a panel or on a pedestal in commonly visible areas of the temple. (Most of Navagrahas Idols present in Shiva temple, it gives give us pleasure and serenity and remove obstacles from our way) Devotees usually propitiate these gods before offering prayers to the main deity in the sanctum sanctorum of the temple. Of the nine deities, seven are named after the planets in the solar system, and correspond with the names of the seven days in the week of the Hindu calendar.
Significance in astrology
The nine planetary gods have a great significance in Vedic astrology. Hindu astrologers draw the birth charts of individuals based upon the their position at the time of their birth. Depending upon where they are located in the astrological chart at a given time, they exert positive or negative influence upon people and their destinies. The position of Sani, Rahu and Ketu are especially considered important. If their positions are not favorable, astrologers suggest remedial measures to pacify the planets and ward off their negative influence.
Reason for having Navagrahas Idols:
Each of the Navagrahas has one supreme goddess. Lord Shiva was appointed by the gods. Shiva is also the goddess of the sun god, the source of the planets. For this reason, all the planets are bound to follow Shiva's direction. That is why Navagraha idols are mostly present in Shiva temples. (Now a days we can see Navagraha in most of temples )
According to mythology, Navagrahas can not have any effect if it is the grace of Lord Shiva. That is why most devotees do not have Navagrahha pooja in the Shiva temples, but the Lord Shiva is certainly anointed with an anhishakam or Archana. If we did like this the devotees believe that if the Navagraha errors will fall. Apart from the Shiva temples, we see Navagrahas in some other temples. But any temple in Navagrahas is good to Pradhikshina around, then we believe that will make/reduce Graha Dosha on us.
Rahu and Ketu: The remaining two deities are actually demons who managed to gain a place in the pantheon through an act of trickery. Their names are derived from either comets or from the dark and somewhat hostile planets of the solar system (Neptune and Pluto). Depending upon their location in the planetary system and their association with the remaining deities, they are deemed either auspicious or inauspicious. Of the nine planets, only seven are actually gods and the other two, Rahu and Ketu are demons. The seven are usually spoken as planets, while the two (Rahu and Ketu) are compared to comets and the like, having a shadowy influence upon the destinies of people.So people used to believe if we offer payers to those two it will not show any effect to devotees.
People use to offer prayers to the Navagraha using Slokas:
Aadhithyaaya Cha Somaaya Mangalaaya Bhudhaaya Cha
Guru Sukra Sanibhyascha Raahave, Kethave Namaha.
Salutations to the Sun God, the Moon, and to Mangala (Mars) and Budha (Mercury). Also to the divine preceptor Brahaspathi and to Sukra, the teacher of Ausuras, and to Sani, the planet Saturn. Salutations to Rahu and Kethu.
Another important point here is that there are many people who doubt that Navagrahas should visit before or after the Shiva temple or visit the Lord Shiva. The Navagrahas in Shiva temple will soon be the first to see whether or not to go to Lord Shiva or Navagrahas. Lord Shiva is the ruler. Lord Shiva taught the subject of duty, so First have to visit the Shiva. Or Navagrahas, but the blessing of Lord Shiva does not have any trouble. Similarly, Navagrahas praying to Lord Shiva give grace to the Devotees.
Like any library, Hinduism Stack Exchange shares great information, but does not offer personalized advice, and does not take the place of seeking such advice from any Acharya, Pundit, astrologer, Guru or other trustworthy Counselor.