You don’t choose the new target for the spell until Ricochet Trap resolves. You must change the target if possible. However, you can’t change the target to an illegal target. If there are no legal targets to choose from, the target isn’t changed. It doesn’t matter if the original target of that spell has somehow become illegal itself.

Artwork
Loading artwork…
Ricochet Trap
The List · #WWK-87 · EN
Nonfoil—Foil—
Card rules
If an opponent cast a blue spell this turn, you may pay
rather than pay this spell's mana cost.
Change the target of target spell with a single target.
In his last seconds, Remhas regretted using his most powerful spell.
Uncommon · Illustrated by Jaime Jones
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
PreDH Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
If you cast Ricochet Trap for
, you don’t have to target the blue spell an opponent cast.
If you cast Ricochet Trap targeting a spell that targets a spell on the stack (like Cancel does, for example), you can’t change that spell’s target to itself. You can, however, change that spell’s target to Ricochet Trap. If you do, that spell won’t resolve when it tries to resolve because Ricochet Trap will have left the stack by then.
If a spell targets multiple things, you can’t target it with Ricochet Trap, even if all but one of those targets have become illegal.
If a spell targets the same player or object multiple times, you can’t target it with Ricochet Trap.
Ricochet Trap targets only the spell whose target will be changed. It doesn’t directly affect the original target of that spell or the new target of that spell.