The MP cost of the spell will be in red if you can't target them with it. That's a far more reliable indicator.