Lightning is a natural phenomenon formed by electrostatic discharges through the atmosphere between two electrically charged regions, either both in the atmosphere or one in the atmosphere and one on the ground, temporarily neutralizing these in a near-instantaneous release of an average of between 200 megajoules and 7 gigajoules of energy, depending on the type.The three main kinds of lightning are distinguished by where they occur: either inside a single thundercloud (intra-cloud), between two clouds (cloud-to-cloud), or between a cloud and the ground (cloud-to-ground), in which case it is referred to as a lightning strike.