Some types of moths are known to migrate, and it's possible that the night sky gives them navigational clues. A moth's up-down orientation might depend in part on the brightness of the sky relative to the ground. Some lepidopterists (moth and butterfly scientists) suggest that moths use the moon as a primary reference point and have the ability to calibrate their flight paths as the Earth's rotation causes the moon to move across the sky. (There is even evidence to support the theory that migrating moths have an internal geomagnetic compass system to guide them in the right direction.) So a moth's attraction to an artificial light or to a fire could be related to orientation, and lead to disorientation -- the moth wasn't "expecting" to actually get to "the moon" (the light source) or to be able to fly above it, so confusion results. It's also possible that moths have an escape-route mechanism related to light. Imagine disturbing a bush-full of moths at night -- they all fly up and out of the bush, toward the sky. To a moth in danger, flying toward the light (which is usually in the sky, or at least upward) tends to be a more advantageous response than flying toward darkness (which is usually downward). Moths are more sensitive to some wavelengths of light -- ultraviolet, for example -- than they are to others. A white light will attract more moths than a yellow light. Yellow is a wavelength moths don't respond to.