What does a firefly use its light for?

To find and attract a mate.