In a laser, some method is used to excite or pump up the electrons (usually it is electrical, but it can be chemical), and create an energy state population inversion. In normal life, all electrons are at the lowest energy level available. By exciting the electrons, it is possible to have large numbers that are at higher energy levels. The difference in energy levels between the excited state, and the next lower state or states determines the energy that will imparted on a photon produced when the electron drops down.If you can get enough of them to 'jump down' at once, you can produce enough photons to be significant, and if you are real smart, you can produce very high energy densities in the 'beam' to make a weapon. Quantum mechanics dictates that these energy levels are discrete, as a result the difference between energy states change can produce one and only 1 energy level in the photon, only a single energy level photon can be produced. According to Physics the energy of a single photon is E=hF, where F is frequency, and h is Plank's constant.
F or frequency must be constant, since we can only have one energy, and plank's constant is just that, a constant.
As a result, by choosing the materials to make the laser out of, you can shoose the available excited electron energy states.
He-Ne will produce a red laser, because the differences between the energy states, the dropping down of the electron produces photos that correspond to a red. Other combinations can produce differing excited electron energy states, and can produce other colors. Carbon Dioxide produces Infrared,I believe Argon can produce Green. Ruby (chromium dopped aluminum oxide) also produces red. By picking the right materials with the right population dynamics you can produce almost anything in the Electromagnetic spectrum from Mirowaves to Ultra violet. A photon in the visible light spectrum is on the order of 1 electron volt.