In our group we often have players missing, and the accepted solution is that all the other players suspend their disbelief that their characters don't especially notice what happens with Bob.
If the player will be missing just one session, Bob is just passively doing whatever he normally does, with the present players often suggesting what it should be ('he attacks those monsters with us, I will roll for him'). When player comes back, Bob recovers from his lethargy and plays fully again, and none of the characters remark about it much.
If it is for a longer time, Bob leaves the party at the first opportunity with some excuse and then catches up later when the player is back. (Heck, we played a game where 2 DM alternated regularly and theirs characters "just went to see grandma" as excuse every time, and it worked too.)
If it is (virtually) forever, Bob just retires and settles down somewhere (say, as village guard, blacksmith, or whatnot) and stay there, occasionally helping the party with requests to "kill this monster/solve that mystery" as a hireling for next adventure, or "fixed their stuff" at a good price as friendly NPC.
You did it another way, but I would suggest talking with the players about making Bob an NPC under your control.
How to explain this in game? Many possibilities:
- Bob (or his food) was poisoned/hexed by enemy at last village — after finishing this dungeon, go investigate the village again — go hunt him (next campaign hook).
- Enemy was disguised as traveler, made some ruckus after party left and then ran away
- Enemy killed and impersonated one of villagers, whose long dead body was then found hidden...
- Enemy forced all village to play along that he is "just another villager" — by threatening to kill somebody (local priestess/mayor's daughter/everybody), or by threating to reveal some dark secret, or just paying them in gold?
- Enemy somehow magically attacked him via some hidden artefact that Bob had, or via another magical bond (so other character are immune to this kind of attack).
- Bob was possesed/cursed long time, and only now have his defences finally been overcome.
- Bob was a trap to lure them here.
- Bob is the servant/chosen enemy of the Big Bad Boss of this dungeon.
What to do with Bob just now? Maybe take control of him right away
- Big circle rise around his body, then he disappears in flash. Later, the PCs will find a scroll/prophecy/explanation of what happend to him.
- Enemy took him away — find and fight the enemy, rescue Bob, or discover his remains.
- Gods/Demons took him due to something he did earlier. He is in Heaven/Hell/Valhalla now and cannot be returned.
Maybe wake him up to be able walk and feed himself and put him under your control.
Bob can explain what happened, or there may be some evidence, or the PCs will only discover that much later.
Bob could be aware of his state or not ("No, my horns have no runes, no I don't talk in my sleep", and he does not see the horns glowing, even in a mirror), or just pretend that he is not aware.
What now:
Bob can just fight as usual during this adventure if it will be too hard without him, but will suffer bad dreams and worsening headaches. After this adventure he will seek healing somewhere, disapearing for years in some church/hospital/whatever.
Bob will fight as usual, then with the loot will just settle somewhere and stop going on such dangerous adventures.
Bob will help them find shortcuts down through dungeon, then present them to his Master as sacrifices — all the party will fight goons, Bob and the final Boss, then get the loot (and maybe a scroll or a prisoner or whatnot which/who explains this devilish plan).
- Bob is the Final Boss (who cast temporary spells on himself to be seen as a "normal adventurer", and now, near the source of his power, the spell finally ends) and brings them to the Final Fight via those shortcuts.
- Bob is The Chosen One to bring down the Final Boss. After getting to the Last Battle, when it's almost all over for the Boss, Bob will attack him, glowing with unnatural light, and kill him with just a touch and a strange spell, dying with him too in one big flame. His purpose to destroy the Big Boss was fulfilled and he will be praised for it for generations. The rest of party will find big loot (and healing potions and such), and will escape safely just in time as the whole dungeon collapses just seconds after their escape.