When a spell is cast and targets one of your permanents, it goes on the stack. You then receive priority and may respond before that spell resolves. Sacrificing the targeted permanent is a legal action at this point, typically done by activating a sacrifice outlet (an ability that lets you sacrifice a permanent as a cost).
Once the permanent leaves the battlefield, the spell's target becomes illegal. When the spell tries to resolve, the game checks whether its targets are still legal (CR 608.2b). If all of a spell's targets are illegal at resolution, the spell is countered by game rules and does not resolve — it simply goes to the graveyard with no effect. This is sometimes called 'fizzling.'
There is an important nuance: if the spell has multiple targets and at least one target is still legal, the spell does resolve, affecting the remaining legal targets as much as possible (CR 608.2b). So sacrificing one target only fully stops the spell when it was the sole legal target.
Concrete example: Your opponent casts Murder targeting your Grizzly Bears. You respond by activating Viscera Seer, sacrificing the Bears as a cost. When Murder tries to resolve, its only target is gone. The game counters Murder by rule, and it goes to the graveyard without destroying anything.
Key rules: priority after casting (CR 117.3b), target legality checked at resolution (CR 608.2b), and spell countered when all targets are illegal (CR 608.2b).
Unofficial fan resource — not affiliated with or endorsed by Wizards of the Coast. Answers are AI-generated estimates grounded in the Comprehensive Rules and are not a substitute for an official judge. Verify anything match-critical.