They are seen as lizard creatures, then they are stunned with a phaser, brought back aboard Voyager, and seen next in human form back in sick bay. How did the Doctor do this?
The Doctor used anti-proton therapy to erase all traces of the mutated DNA from their system.
Unfortunately the same treatment won't erase all memory of this episode from my brain.
In universe, from Memory Alpha
ie it was magic.
Out of universe, it was a sordid assault on rational thinking by a writing staff who should have known better1. From Memory Alpha again:
1 And, to be fair, they did do much better for the rest of Voyager's seven seasons.