Well actually, I just researched, and while not having a true mass, a high energy photon can act like having mass, "If by mass you mean the inertial mass (the m in the momentum-velocity relation p=mv) a photon can gain some by falling in a gravitational field"
So while not possible for a photon to have mass, the author probably got this information to do this beam attack