Lightening is a flash of light caused by the electrical discharge. It is visible from great distance. When the ice and rain drops above the freezing level collide with each other, separated electrical fields are formed in the clouds. When these become strong enough to overcome the resistance of air, a big spark takes place which reduces the charge separation. This spark or lightning bolt can take place between clouds, between cloud and air and even between cloud and land.
The accompanying thunder is caused by the rapid expansion of the air. When lightning moves through the air, it rises the temperature of the air which again cools down very quickly. This quick expansion and contraction causes the sound waves that accompany lightning.