That's a crown flash, it happens when ice crystals in the clouds are aligned by the electromagnetism, and when the electric field changes (typically due to lightning or something similar) the alignment suddenly changes. The beam of light is the refracting the light into a different direction, making it seem like someone has a giant flashlight up there or something.