Lightning can reach temperatures of 30,000 kelvins (53,540 degrees Fahrenheit), compared to the surface of the sun, 6,000 kelvins (10,340 degrees Fahrenheit).
Lightning is an atmospheric electrostatic discharge (spark) accompanied by thunder, which occurs during thunderstorms, and sometimes during volcanic eruptions or dust storms. From this discharge of atmospheric electricity, a leader of a bolt of lightning can travel at speeds of 220,000 km/h (140,000 mph), and can reach temperatures approaching 30,000 °C (54,000 °F), hot enough to fuse silica sand into glass channels known as fulgurites which are normally hollow and can extend some distance into the ground.
In case of the sun, the indicated surface temperature is approximately 5778 K (5505 °C). Sun, like most stars, is a main sequence star, and thus generates its energy by nuclear fusion of hydrogen nuclei into helium. In its core, the Sun fuses 620 million metric tons of hydrogen each second.
Lightening causes a strong electric field which ionizes the air around the cloud, separating air molecules into positive ions and electrons. Electrons move far more easily in ionized air. When channel of ionized air is established from the cloud to the ground, high-temperature current flows in the form of a lightning stroke and establishes a temperature, which is 5 times hotter than the Sun.
The temperature tells you the energy of an average particle, but since you don't know the number of particles in the system, you can't know the total energy. And it is this energy that does the damage, not the temperature.
And to think that researchers have also disproved that lightning strikes only once, the consequences are alarming.