Black beetles are attracted to light bulbs because they mistake them for the sun. This is why you often see black beetles gathered around porch lights or streetlights.