Drones are really cheap, you can field thousands if you get around to producing them.
Shooting them down with guided missiles would be really expensive. Shooting them with machines guns might also be expensive since it may take a hundred shots to bring down one drone.
So “ray guns” are perhaps the most economical method. The “projectile” travels at the speed of light because, well, it’s light! And visible light targeting is easy enough and very VERY fast to track something like a drone.
Electricity for such a beast is a lot, ($5 to $10 for a shot with a 300 Kw laser), but this is not much compared to other projectiles, which could run from $10,000 per shot to much more.
Development continues. Power sources are heavy, awkward and tough to shrink. A hand held “ray gun” may take a while to come out. But this is the wave of the future.