Volcanic lightning is an electrical discharge caused by a volcanic eruption. When an active volcano erupts, hot gases and ash rise through the lava face into the sky, sometimes penetrating even the stratosphere.
Inside this warm gray cloud, rock fragments and ice particles generate electric charges. When all the parts of this burning hot object collide with each other, they generate static charges like a normal thunderbolt, and then lightning flashes. The best example is the Sakurajima volcano in Japan.