Dark Spirits invade your world as red phantoms in some areas—these invasions are identical to an invasion by another player, with the obvious exception that these are AI controlled NPCs.
Because the specific challenge of the phantom depends on their loadout, you may find yourself facing a heavily armored melee tank, a lightweight ranged caster, or a nimble melee dodger.
The Undead Hunter Charm is of particular use against NPC Phantoms, it shuts down the use of Estus, which prevents these foes from healing! However, you can achieve the same goal with a simple Throwing Knife if you have one equipped and act fast, but keep the option in mind.
Phantoms block your ability to leave the area with fog doors, just like regular multiplayer invaders do, so you must defeat them before you can escape.