It's both a defensive and offensive spell. It can protect you from enemy rays, but you could also have an ally shoot you to give you a spell and to protect you from melee attackers.