It’s been so monstrously hot this summer, I began contemplating mirages and where they come from. Thus I looked up a bit of the science behind a typical mirage. From my trivial title questions above, you may have guessed that photons play a role in mirages, but how?

Ocean waters and cloudy sky surrounding a small tropical island at sunset; image by jplenio from Pixabay https://pixabay.com/photos/sunset-waters-sky-dawn-water-3125887/
First, let me back up a bit to give a brief explanation of what photons are. Photons are what light is made up of; they’re both a particle and a wave, which makes them quite different, but this fact also gives photons some unique properties (such as diffusion and refraction). Anyway! If you think of light as being made up of a bunch of photons, you’ve got the basic idea.
…So now that you know light is made up of photons, if you had a bunch of them race side-by-side, some through a bunch of hot air and some through cold air, which photons would win? The ones going through the hot air. Why? Because hot air is less dense then cold air. Think of it like this: cold air is like honey while hot air is like tomato soup. Getting through the honey takes more effort because it’s so much thicker than tomato soup.
Another thing photons tend to do is take the easy route, even if it’s a longer distance. Let’s say, for example, the black tar in the road ahead is heating up and getting really hot; that means the hot air around it will be thinner, like the tomato soup in my example above. But let’s also say a really chilly breeze is blowing off the ocean nearby and cooling down the air above the road; this means that air will be more dense, like the honey. Since photons would rather move a longer distance and go around (through the hot air), photons coming down from the sky above will move in a wave-like path to avoid that colder air if they can, thus making the light “bend”—which your brain interprets as water on the road because water also moves in waves—and, yup, the effect creates a mirage.
In addition, I want to mention how fast the air changes from hot to cold—known as the gradient—also matters, along with how flat the surface is, because these also affect whether or not a mirage occurs. A simple way to create your own “mirage” is to put some cold water in a clear drinking glass, then place a pencil or pen in the glass and view it from the side. The pencil/pen will appear to be splintered with the underwater portion looking larger, but of course, you’re now savvy to the fact that this is only an illusion. 😉

Hot road with water mirage effect; image by Junior Peres Junior from Pixabay https://pixabay.com/photos/road-rent-a-car-hot-road-242463/
So to answer that second question above—what do photons have to do with mirages? I would say photons have everything to do with mirages! Photons make up the light we see and when they refuse to travel in a straight line (which is basically what they’re doing when we see a mirage), we literally can’t see straight.