The sun is a hot ball of gases that has temperatures up to 6,000 degrees Celsius. This extreme heat causes big explosions called solar flares that can release the energy of 10 million hydrogen bombs.
During solar flares the gas atoms to break apart, causing protons, neutrons, and electrons to separate. Some of the particles escape into space, and these moving particles are called solar wind .
The solar wind travels in all directions away from the sun and some of it heads to Earth and toward the planet's magnetic field.
You can see the solar flare erupting in the upper right hand corner. The sun is 1,390,000 km (863,746 miles) in diameter. This flare is about ¼ the diameter in height which is 347,500 km (215,937 miles) high!
courtesy of http://astrogeology.usgs.gov/assets/wallpaper/