I have heard though that the ray doesnt have to sting you for it to hurt. Just a brush up against you with the barb will hurt as well. So the post I posted earlier was just from something I read online. But in my opinion, I think a ray can get you from any direction. Meaning to or not....
I watch River Monsters alot and he said on one of his freshwater ray shows that just a tough from the barb will hurt. And like some have said on here, being behind, on the side or even in the front, If the ray wants to sting you, or trashes to just get away, it can hurt just being hit by the bard in anyway.
Mine, so far... have not stung me. I have however been cleaning and scared them from time to time and they trash trying to get away.