In an ash cloud, there are many types of particles, ranging form microscopic rock particles to sulphur and other poisonous gases. When these particles, which travel extremely fast, collide, they cause an immense build up of static charge in the cloud. Regular clouds do the same thing, but they create static charge through the collisions of water particles in the clouds.
While these collisions are happening, negative charge is building up in the cloud itself.
This starts going into electricity (Physics), but I'll try to give you the short and sweet facts. Like the above illustration you should have painted in your mind, the ground does the same thing. (It is important to realize that opposite charges attract). Once there is a high enough voltage, the static charge will ark and connect/stabilize the charge, which we see as a lighting bolt.
Volcanoes tend to create magnificent sparks of electricity because of the dense clouds of particles they spew into the air, which are much more concentrated than regular storm clouds.