You can cancel the cast. Since it's not interrupted by movement like normal casts, you need to press ESC (or whatever the console equivalent is). Ranged is just shit at defense anyway, you should never be standing at reach from the enemy. If there is no allies between you and them, you probably screwed up somewhere to begin with and canceling any cast won't save you.