By the time you encounter a gray ooze, you should be more than capable of defeating it easily, unless you are a Tourist. Its rusting attack and ability to pass under doors makes this monster more annoying than dangerous.
It's best to take gray oozes out with ranged attacks as they are very slow, if not persistent. If you lack the means to kill it from afar and don't want to expend a wand's charge on it, let your pet deal with it. If all else fails, you could punch it to death after unequipping all iron equipment. Only do this if it is safe to do so, i.e. there aren't any other monsters nearby.