Phosphoric acid combines with iron oxide (rust) to form iron phosphide, which is inert - it doesn't corrode any further. The most common product made of phosphoric acid for this purpose is called Naval Jelly, available at any hardware store.
Usually acids are known to affect metals. this rule applies for acid + metal reactions. An acid + a metal reacts to give a metal salt + hydrogen Eg: Zinc + Hydrochloric acid reacts to give zinc...