The Stack

Spells and activated/triggered abilities don't resolve immediately: they wait on the stack. The most recently added object resolves first (LIFO — last in, first out). An object resolves exactly when all players pass in succession. Afterwards the active player receives priority again — so only ONE object ever resolves at a time, and everyone may respond in between.

Step / 5

You cast Lightning Bolt

In your main phase you cast Lightning Bolt targeting your opponent (targets are chosen while casting!). The spell is now on the stack — NOTHING has happened yet. You get priority again first, pass, then your opponent gets priority.

Opponent responds: Counterspell

Instead of passing, your opponent casts Counterspell targeting your Lightning Bolt. Counterspell is now ON TOP of the stack, above the Bolt. If both players passed now, Counterspell would resolve first.

You respond: Dispel

You still have a blue mana available and respond to the Counterspell with Dispel (counter target instant spell). The stack is now three objects tall. Both players pass — resolution starts from the TOP.

Dispel resolves

The top object resolves: Dispel counters the Counterspell — it moves from the stack to the graveyard and will never do anything. Then the active player receives priority again; both pass once more.

Lightning Bolt resolves

Now the Bolt is on top of (and alone on) the stack. As it resolves it re-checks its target: still legal, so it deals 3 damage to your opponent and goes to the graveyard. The stack is empty — the game continues in your main phase.

The stack

Opponent's life:

Lightning Bolt

3 damage to any target → opponent

Counterspell

Counter target spell → Lightning Bolt

Dispel

Counter target instant spell → Counterspell

empty

Key takeaways

  • The stack ALWAYS resolves one object at a time — between two resolutions every player receives priority again.
  • A countered spell does nothing at all — it goes straight from the stack to the graveyard.
  • As an object resolves, each target is checked again: if ALL its targets have become illegal, the spell fizzles (it isn't "countered", but it does nothing).
  • Mana abilities and playing lands don't use the stack — nobody can respond to them.
  • Triggered abilities go on the stack the next time a player would receive priority — even in the middle of your "response chain".
Rules: 601.2 117.4 608.2b 405.5

601.2To cast a spell is to take it from where it is (usually the hand), put it on the stack, and pay its costs, so that it will eventually resolve and have its effect. Casting a spell includes proposal of the spell (rules 601.2a–d) and determination and payment of costs (rules 601.2f–h). To cast a spell, a player follows the steps listed below, in order. A player must be legally allowed to cast the spell to begin this process (see rule 601.3). If a player is unable to comply with the requirements of a step listed below while performing that step, the casting of the spell is illegal; the game returns to the moment before the casting of that spell was proposed (see rule 733, “Handling Illegal Actions”).

117.4If all players pass in succession (that is, if all players pass without taking any actions in between passing), the spell or ability on top of the stack resolves or, if the stack is empty, the phase or step ends.

608.2bIf the spell or ability specifies targets, it checks whether the targets are still legal. A target that’s no longer in the zone it was in when it was targeted is illegal. Other changes to the game state may cause a target to no longer be legal; for example, its characteristics may have changed or an effect may have changed the text of the spell. If the source of an ability has left the zone it was in, its last known information is used during this process. If all its targets, for every instance of the word “target,” are now illegal, the spell or ability doesn’t resolve. It’s removed from the stack and, if it’s a spell, put into its owner’s graveyard. Otherwise, the spell or ability will resolve normally. Illegal targets, if any, won’t be affected by parts of a resolving spell’s effect for which they’re illegal. Other parts of the effect for which those targets are not illegal may still affect them. If the spell or ability creates any continuous effects that affect game rules (see rule 613.11), those effects don’t apply to illegal targets. If part of the effect requires information about an illegal target, it fails to determine any such information. Any part of the effect that requires that information won’t happen.

405.5When all players pass in succession, the top (last-added) spell or ability on the stack resolves. If the stack is empty when all players pass, the current step or phase ends and the next begins.