Remove each grate from the stove by lifting its front edge and wiggling it gently until the grate pops loose. If you encounter resistance, push the grate back into place, and it pull forward quickly, popping the grate out of the stove.
Place the grates in a garbage bag. While wearing rubber gloves, pour 1 cup of ammonia into the bag. Quickly tie the trash bag shut, and place it outside for several hours or overnight. Wear the rubber gloves and a dust mask or respirator as you open the bag and remove the grates. Rinse the grates with fresh water, and pat them dry with a rag or towel. The ammonia fumes soften the burned-on food bits until the debris falls off.
Lay the stove grates on newspaper spread across your work area. Rub fine-grit sandpaper over the front of the grates. Also sand the back of the grates if you plan to paint the backs. The sandpaper removes texture and gloss from the metal.
Shake a can of oven-safe spray paint gently for at least 60 seconds. While holding the paint can at least 12 inches from the front of the grates, press down on the can's nozzle and apply an even coat of paint to each grate. Wait at least 10 minutes for the first coat of paint to dry, and then apply a second coat of paint. Wait for the second coat of paint to dry.
Turn the grates over if you want to paint their back, and apply two coats of paint to the back of each grate. Let the first coat dry before applying the second coat.
Reattach the grates to your stove by pushing the grates into the burners.