Like all puddings, gray oozes leave a glob instead of a corpse. This can be eaten like a corpse, and may become tainted, but never fully rots away. The glob is acidic and has a chance of conveying fire, cold, or poison resistance.
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.
In NetHack 3.4.3 and earlier, gray oozes left a corpse instead of a glob when killed.
In NetHack 3.6.0, globs could not give resistances when eaten. This was fixed in 3.6.1.
These giant amoeboid creatures look like nothing more than
puddles of slime, but they both live and move, feeding on
metal or wood as well as the occasional dungeon explorer to
supplement their diet.
But we were not on a station platform. We were on the track ahead
as the nightmare, plastic column of fetid black iridescence oozed
tightly onward through its fifteen-foot sinus, gathering unholy
speed and driving before it a spiral, re-thickening cloud of the
pallid abyss vapor. It was a terrible, indescribable thing vaster
than any subway train -- a shapeless congeries of protoplasmic
bubbles, faintly self-luminous, and with myriads of temporary eyes
forming and unforming as pustules of greenish light all over the
tunnel-filling front that bore down upon us, crushing the frantic
penguins and slithering over the glistening floor that it and its
kind had swept so evilly free of all litter.