Phyrexian Altar's activated ability reads: 'Sacrifice a creature: Add one mana of any color.' This is an activated ability with no special timing restrictions, so it can be activated any time you have priority — including during the opponent's turn after a spell targeting your permanent has been placed on the stack (CR 116.2a, 602.2).
When you sacrifice the permanent in response, it leaves the battlefield immediately as the cost of the ability (CR 602.2a). A sacrificed permanent ceases to exist on the battlefield, so by the time the targeting spell attempts to resolve, its target is no longer a legal target (CR 608.2b). A spell with all illegal targets is countered by the rules and does not resolve.
This is a well-known interaction sometimes called 'sacrificing to deny a target.' It works because paying the cost (sacrifice) happens before the spell resolves, and legality of targets is checked at resolution (CR 608.2b). Note: spells or abilities that don't target, like 'destroy all creatures,' cannot be dodged this way.
Example: Your opponent casts Terror targeting your Grizzly Bears. Before Terror resolves, you activate Phyrexian Altar, sacrificing Grizzly Bears to add one green mana. When Terror tries to resolve, Grizzly Bears is gone — Terror has no legal target and is countered by the game rules. You keep your mana and your opponent's spell does nothing.
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.