Why do lightning bugs light?

To find a mate.