Volcanic lightning was documented by one of the earliest American volcanologists, Frank A. Perret in the 1940s. However, there was not much, if any, study of the phenomena until recently. According to this article, the electric charge develops close to the ground where the plume gas thrust region at a few hundred meters above the crater rim, where the overpressure of the turbulent volcanic jets determines the electrification of particles generating a complex charge structure in the growing plume."
The abstract of another journal article indicates that additional lightning can be generated in the stratosphere, "Observations and volcanic plume modeling further suggest that electrical activity was enhanced both by ice formation in the ash clouds >10 km above sea level and development of a low-level charge layer from ground-hugging currents."