Can anyone remember what episode of Star Trek it was that an alien species entered the body upon death and drew on the person of the deceased, on their memories, their personality, until it gradually took over? I remember furrowed brow, gray complexion, and that the starship doctor gave the woman an injection that returned her to normal, or so it seemed
A long-presumed-dead crewmate returns to Voyager, pursued by the aliens who revived her
The aliens are the Kobali:
Their method of reproduction was unique and their most distinguishing characteristic: they added to their population by reanimating the deceased corpses of other species, altering their DNA to transform them into fellow Kobali.
And their appearance matches your memory:
I'm going to guess you're misremembering an Andromeda episode as Star Trek.
Episode 2x15, Dance of the Mayflies, involves an infectious parasite that first kills, then reanimates corpses. The parasites are sentient, and partway through the episode they communicate through Trance's body after infecting her. She's a pale purple for most of the season - the far left in this image of the crew from that season (maybe you'll recognize the rest of them?):
By the time this episode comes around, she's exchanged places with her adult self, pale with a golden sheen:
Eventually they figure out a strong electric shock will destroy the parasites, and start using their main handheld weapon, Force Lances, at full power on the corpses but can only fire 3 shots on each before it runs out of power. However, in order to kill the parasites in anyone still living, they inject nanobots modified to deliver the shocks directly to the parasites without harming the host.
Andromeda doesn't have a ships doctor, but Trance often acted as one. From what I remember and a small part of the linked summary, Trance was freed by the parasites by the lethal shock, but didn't die. She was the one that then modified the nanobots.
(Aside: Trance's body did not react the same as anyone else's when she came into contact with the parasites. She didn't die, they took over her completely when she was first infected; that's how she was able to be rescued despite the parasites having control over her body, when they needed to kill everyone else to get control. This was one of the major clues that there's something seriously different about her species, before we started getting answers.)
The episode is called "Coda" (1997) from Star Trek: Voyager.
Chakotay and Janeway crash on a planet and are stuck in a time loop where Janeway dies.
I found the exact episode because I was searching for the same one. The idea that an alien parasitic race recycles souls by pretending to be the newly deceased relatives who lure them into the light where they will be eaten is frightening, because what if it's true?