The phenomenon is knows as magnetic reconnection, when magnetic field lines come together, break apart and then exchange partners, snapping into new positions and releasing a jolt of magnetic energy that can fling radiation and particles across the solar system.
The resulting space weather can affect satellites near Earth and interfere with radio communications, NASA scientists said.
Magnetic reconnection, which lies at the heart of giant explosions on the sun such as solar flares and coronal mass ejections, is hard to study because it can't be witnessed directly, since magnetic fields are invisible, they said.
However NASA's SDO, short for Solar Dynamics Observatory, has now provided images of magnetic reconnection as it was happening on the sun.
While the magnetic field lines themselves are invisible, they force charged particles to course along their length, which space telescopes can see as bright lines looping and arcing through the sun's atmosphere.
Scientists have used observations of these lines to map out the presence of magnetic field lines and witness magnetic reconnection as it happens.
Observations from a second spacecraft, a solar spectrographic imager, helped confirm the SDO's evidence.
"This is the first time we've seen the entire, detailed structure of this process, because of the high quality data from SDO," Yang Su, a solar scientist at the University of Graz in Austria, said. "It supports the whole picture of reconnection, with visual evidence."
2014: NFL Cheerleaders [PHOTOS]
Antarctic fish have antifreeze in their veins