Most ships still have at least one gun although it is rare to find one with more than a 6-inch bore. The standard these days is a 76mm such as the one on the US Perry class frigates. The Burke class destroyers have a 5-inch gun. Pretty much every ship has some sort of close-in weapon system. In general the laser systems are intended to replace these. The problems with beam spreading, blooming (de-focusing caused by the heating of the air by the beam), as well as absorbtion by sea-spray and humidity limit the effective range of a laser. Picking the right frequency is hard since the quantum mechanics of available lasing media limit the choices. The US Navy's current research on this is working on a Free Electron Laser. Since these use the energy of an electron beam and synchrotron radiation to form the beam you can build one to an advantageous frequency. It does mean putting a small electron accelerator onto the ship, which may be problomatic.
"I often say that when you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meagre and unsatisfactory kind." - William Thompson, 1st Baron Lord Kelvin
"If it was so, it might be, and if it were so, it would be, but as it isn't, it ain't. That's logic!" - Tweedledee
This isn't right. This isn't even wrong. - Wolfgang Pauli