Sometimes we come across oven racks which look dirty, however the metal plating has actually been damaged. This then leads to the metal beneath rusting.
This could be down to cheap chrome plating. Other racks may be stainless steel which again can lose its protection against corrosion. Once the metal protection is damaged then it is open to either chemical or moisture corrosion.
Either an over exposure to oven pride or similar products containing damaging Sodium Hydroxide AKA caustic soda. Another reason is that when people cook, it creates moisture inside the oven. When the food is cooked it is taken out and the oven door closed. This leaves a build up of moisture/steam inside still which sits on the racks. The oven may not be used for a few days and this can cause rust to appear if the chrome plating has been damaged.
Tarnishing may be removed rubbing with “tin foil” apparently, but that could be an old wives tale. Some oven racks can be damaged with self cleaning ovens depending on manufacturers recommendation.
So the solution to this problem is firstly to avoid using strong caustic cleaning products. Secondly, leave the oven door open after cooking to make sure there is no moisture left.
To avoid the mistakes that can lead to damaging your oven racks you might want to consider a professional oven cleaning company.