Diffraction
When starting out thinking about lasers, a lot of people think that they just go in a perfectly straight line forever. But no, physics is not as permissive as that. Light is a kind of wave, a wave made up of electric and magnetic fields but a wave nonetheless. And when waves encounter an obstacle, they can bend around the obstacle. Think of ripples in a still pond encountering a reed poking up through the water - the reed doesn’t cast a perfect shadow behind it. No, those ripples bend around and fill in the space behind the reed as well. In a similar way, if the ripples hit a wall with a hole in it, the ripples that go through the hole won’t march on in a perfectly straight column. Rather, they spread out as soon as they go through the hole. This bending and spreading out is called diffraction. Diffraction is a fundamental property of any wave in nature.
The smaller the wavelength of a wave in comparison to the size of the obstruction or opening, or the width of the beam, the less the wave diffracts. Since visible light has a very small wavelength, this is why light seems to travel in straight lines. It takes very narrow objects, such as hairs or thin scratches, to get noticeable diffraction. This is easy to demonstrate with a laser pointer in a darkened room. Shine the beam at a wall. Now put a hair in the beam. You will see a streak appear on the wall through the laser dot perpendicular to the hair. The streak is the light diffracting around the hair.
For a laser, we need to shine our beam on something. But as soon as the laser gets out of the machine that is making it and guiding it, it diffracts around the aperture that emits the beam into the wider world. This diffraction limits the amount by which the laser can be focused, or even by which it can move straight. This means that if you try to focus the beam down to a tiny point at a distant target, the beam might spread out to a much larger spot by the time it gets there. The amount the beam expands depends on the ratio of the initial width of the beam to the wavelength of the beam. In fact, we can determine the smallest possible spot size into which you can focus the beam: if we denote the diameter of the mirror, lens, or other opening in the laser or focusing element as , the wavelength of the light as , and the distance to the target as , then the diameter of the smallest spot, , is given by
Note that to focus well, which gives you long range and maximizes your damage and armor penetration, you want to have your focal aperture be as large as you can get it! This is entirely the opposite of the intuitive idea that you want to shoot out a straight, narrow beam out of a small hole; because the beam is focused, not straight and wide apertures let you focus better. Just like a bigger lens on your camera lets you take higher resolution pictures from a long way away, a bigger lens on your laser gun lets your beam have a higher resolution (smaller spot size) when projected far away.
Diffraction also encourages using shorter wavelengths so you can focus damaging spots at longer ranges. Practically, you will probably not want to consider any wavelength longer than short-wave infrared for causing physical damage to a target. Historically, some long-wave and mid-wave infrared lasers were explored for laser weapons, but these are largely obsolete now. Microwave beams are used for counter-electronics weapons, but not for burning your target up because they simply can’t focus well enough. For space combat, you will want to use as short of a wavelength as is practically achievable by your technology. (In air, very short wavelengths have other problems, as will be discussed elsewhere.)