An ice maker consists of a motor, a water valve, an ice-making tray and an auger. The motor turns on the water valve to allow water to flow into the ice tray. When the ice is frozen, it is released into the bin below. The auger is an "arm" in the bin that sweeps ice down and out the dispenser when triggered. If the trays and auger are not composed of stainless steel or plastic, they might rust. The motor might rust as well, if there is too much frost buildup or if the ice bin overflows. In most cases, however, a wire lever shuts off the water valve, which prevents the bin from overflowing when it gets too full.
Ice dispensers are located in the door of the freezer. They are located close to the ice maker. When the lever on the dispenser is pushed, it triggers the auger to move and sweep ice into a chute, where it falls down and out through the dispenser and into your cup. In some refrigerators, the auger may also crush the ice, if that option is chosen. If humidity levels in the freezer are high, rust may accumulate on the chute or even on the external lever of the dispenser.
Although there are commercial products available that prevent rust, none are made to withstand continuous water exposure. For that reason, it is not possible to put anything on the ice maker itself to prevent it from rusting. Instead, remove the components that are rusted, scrub the rust off with steel wool, and wash them with soap and water. The instructions that came with your refrigerator tell you how to dismantle and reassemble your ice maker. If the rust is on the ice maker's motor, you must call a professional, because the rust may interfere with the ice-maker's ability to function properly.
Ice dispensers are not exposed to as much moisture as the ice maker itself. If rust is accumulating on the external part of the dispenser, use a commercial rust-repelling product designed for appliances. These are formulated to be used on the outside of appliances and ice dispensers only. Some are colored like spray paint, while others are clear. Clean the rust off the dispenser first, and then apply the rust repellent according to the instructions on the product label.