Cause
Flares occur when accelerated charged particles, mainly electrons, interact with the plasma medium. Scientific research has shown that the phenomenon of magnetic reconnection is responsible for the acceleration of the charged particles. On the Sun, magnetic reconnection may happen on solar arcades – a series of closely occurring loops of magnetic lines of force. These lines of force quickly reconnect into a low arcade of loops leaving a helix of magnetic field unconnected to the rest of the arcade. The sudden release of energy in this reconnection is in the origin of the particle acceleration. The unconnected magnetic helical field and the material that it contains may violently expand outwards forming a coronal mass ejection. This also explains why solar flares typically erupt from what are known as the active regions on the Sun where magnetic fields are much stronger on average.
Although there is a general agreement on the flares' causes, the details are still not well known. It is not clear how the magnetic energy is transformed into the particle kinetic energy, nor is it known how the particles are accelerated to energies as high as 10 MeV (mega electron volt) and beyond. There are also some inconsistencies regarding the total number of accelerated particles, which sometimes seems to be greater than the total number in the coronal loop. We are unable to forecast flares, even to this day.
Read more about this topic: Solar Flare