In this sentence, the bright flashes of lightning are being personified as dancers. This gives the lightning a sense of movement and energy, and suggests that it is almost alive. It also creates a sense of beauty and wonder, as if the lightning is putting on a performance for the observer.