If the guardian is charging his beam it turns green at the end and then damage the player. Only in the versions 1.8.2-pre5, 1.8.2-pre6, 1.8.2-pre7 and 1.8.2 this works. I think it's a bug or it is a new thing from the guardian.
Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time.
Not fixed for 15w49b, for a very short time the beam is still green at the end