So I was playing a friend and he had a Lantern Spirit on the field. I used a card ability to exile it, but he said he could pay that one blue mana to put it back in his hand. I'm pretty sure that's not legal, but I couldn't prove it wasn't, so I let him (it was OK in the end I completely crushed him). Does anyone know where the rules regarding this kind of thing are?
When you put the exile ability of your card (call it E) on the stack, your opponent gets priority and will be able to react by playing e.g. an instant or in this case, any card abiltity which can be played as an instant. Lantern Spirit's ability is such an ability; it will be put on the stack as well, and unless you react on it (e.g. with another instant), it will resolve before E. This is a bit counterintuitive (unless you're a programmer and heard about stacks before) - why should an ability/spell which is cast later resolve earlier? – but this is how Magic works. Lantern Spirit will return to its owner's hand and E will (if Lantern Spirit is its only target) 'fizzle', i.e. have no effect, because its target has already changed zones. It won't exile the card from its owner's hand.
What happens here in detail?
- You are the active player (main phase, your turn, for example).
- You cast a spell which targets Lantern Spirit.
- You pass priority to the next player, in this case, to your opponent.
- Your opponent uses the activated ability of Lantern Spirit, in order to return it to his hand, as a reaction.
- You gain priority and pass.
- He gains priority and passes.
The stack resolves (first in, last out):
- Lantern Spirit is returned to your opponent's hand,
- then your exile-spell tries to resolve, fails to find the original target, and fizzles.
In short: Your friend was right, it is a legal move.
Your friend was absolutely right, he is able to respond to your attempt to exile his spirit by activating the ability of Lantern Spirit. The stack is what Magic calls the ordered spells that have been cast and abilities activated but not yet resolved. Putting things on the stack is handled by a few rules, 601.2 for spells, 602.2 for activated abilities and 603.3 for triggered abilities. Here's the text for the rule on spells, they all say the same basic thing, the spell/ability is put onto the stack (on top) where it will eventually resolve.
601.2 To 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 725, “Handling Illegal Actions”).
Let's say you had used Swords to Plowshares (Swords) as your exile spell, that puts Swords onto the stack at the top of the stack, the only spell there so it is also the bottom. Your opponent then activates the ability of Lantern Spirit, putting that ability on top of your Swords. Each player then needs to pass priority (their opportunity to respond to the lantern spirit ability with another instant speed effect) so the first spell or ability on stack will resolve:
608.1 Each time all players pass in succession, the spell or ability on top of the stack resolves. (See rule 609, “Effects.”)
Magic resolves the stack in reverse order they were put on the stack, as 608.1 says, the top of the stack resolves each time priority is passed by all players. In this case the top of the stack is Lantern Spirit's ability to return itself to hand. This then happens. Now your Swords is still on the stack, but no longer has a target, so this is handled by 608.2b:
608.2b If 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.
As it says in that rule "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." So your exile is put into the graveyard if it was a spell, like the swords I used in the example or just removed from the stack and ceases to exist if it is an ability.