As rust monsters have a speed of 18, faster than most players, running away is usually not possible.
The best way to deal with them is to rustproof your equipment, effectively rendering their attacks completely harmless. If this is not an option, you can fight them from a distance while avoiding melee combat by using Elbereth or similar means. Alternatively, unequipping iron armor may help if no other dangerous monsters are around; consider their high speed when doing this to avoid them moving next to you before you are ready to fight them.
As non-metal weapon, unicorn horns can be useful to fight them.
Rust monsters are metallivores; however, unlike most metallivores, they will only eat rustprone metal. They will try to eat rustproof items, but "spit them out in disgust", removing the rustproofing. 
They will eat a worn ball and chain (from punishment) and rust other monsters' iron items when attacking them. Because of this, they make semi-useful pets if you don't want any more iron items.
As player polymorphed into a rust monster, trying to eat a rustproof item will give the message "Ulch - That <item> was rustproofed!", then will stun you, followed by spitting the item onto the floor.
Before NetHack 3.1.0, rust (and other forms of object erosion) did not exist. Rust monsters and other things that caused rust instead reduced the enchantment; in the case of rust monsters this could go as low as -2. Thus rust monsters in older versions behaved more as modern disenchanters, save that their attack was still subject to an object's susceptibility to rust.
These strange creatures live on a diet of metals. They can
turn a suit of armor into so much useless rusted scrap in no
time at all.