Refraction Trap doesn’t target the source of the damage it prevents. You choose that source as Refraction Trap resolves. If you cast Refraction Trap for {W}, the source you choose doesn’t have to be the red instant or sorcery spell an opponent cast.