The Ray Gun would make sense only if...
... If it wasn't an ordinary ray gun but instead was a battery storing Freeza'a golden power. Meaning, prior to the battle, Freeza stored some of his energy into that gun as a backup plan.
If it's an ordinary ray gun, it makes zero sense whatsoever.
--==--==--==--==--==--
Avengers: Age of Skyne-- err, Ultron