I’m sure all of us have looked outside in the evening at our porch lights and cringed at the sight of what seems like hundreds of flying insects hovering around and/or crashing into the light, over and over. Some of them (June beetles, especially) are left on their backs on the ground, trying desperately to right themselves. And then, you spot other animals hanging out on walls nearby, just basking in the glow of your porch light. (like geckos or spiders)
These bugs seem to turn into robot zombies when they see the light and spiral closer and closer until they ram into it…and then keep on ramming into it like a drunk.
What is up with this?! It’s pretty annoying…(unless you’re an entomologist trying to collect bugs for study)
There are several theories floating around, but the one that makes the most sense is the idea that moths and many other nocturnal flying insects use transverse orientation to “navigate”.
Transverse orientation is
“keeping a fixed angle on a distant source of light for orientation.” 
Usually, nocturnal insects have a distant yet intense light source that they set at a certain angle in their field of vision to maintain a certain direction of flight: the moon. This allows them to travel in a somewhat straight line (the moon rises and sets, but it works well enough) and not end up flying around in circles. (This is much like using the north star for navigation, which doesn’t rise and set)
However, there are artificial “moons” we make that throw the insects off: artificial light bulbs and even camp fires. These light sources look like the light coming from the moon in many cases, so insects lock onto them and try to use them as a guide.
The problem: Let’s say you put a light source in the right side of your field of vision and try to keep it in the same place as you fly. If the light source is not on the same planet as you, it helps you maintain a steady direction and you’re happy.
The problem arises when the light source is on the same planet as you…and is actually fairly close to you. When you try to maintain the light on your right side, you’re going to end up flying in circles around it, getting closer and closer. Basically, you’ll end up spiraling into it and hitting the bulb or flying directly into the fire…which is exactly what happens to the unsuspecting insects.
When they run into the light source (literally), all havoc breaks loose and they seem to have no idea what is going on. They can even hurt themselves, especially if the light bulb is really hot (…or is fire) or there are electrified wires surrounding the bulb. ( <–sneaky)
Now, not all light bulbs attract these poor fellas. The light has to be intense enough and enough like the moon’s light…which is reflected sunlight, so it will have UV light as well. So, bright white lights and blue lights are the ones that are going to attract the most bugs, especially if they produce UV light. Lights with a longer wavelength (such as yellow) are not going to attract bugs as well, if at all.
I can personally vouch for this, as I was having a hard time collecting nocturnal insects for my entomology class because our porch light is yellow…I resorted to using an LED light, which worked, but I think our apartment management pretty much killed off most of the insects in the apartment complex; I only caught one lacewing.
Note: A good way to catch a lot of insects at night is to take a flashlight and a white sheet out to a field or park and get someone to turn on and hold the flashlight behind the sheet. Bugs will come flying and land on the sheet, and all you have to do is slide them off into your container.
As for the geckos and spiders chilling around the light, you don’t need to be worried for them; they’re getting the easiest meal of their life. Although, they are probably being stalked from the shadows by bigger things that will eat them, so maybe they do need to be worried…