Solar sails work by using the pressure of sunlight to propel a spacecraft. Photons from the Sun, though massless, carry momentum, and when they reflect off a large, reflective sail, they transfer this momentum to the spacecraft, providing a continuous, though small, push. This constant force, unlike the short bursts from rockets, allows for gradual acceleration over time.