The outer layers of the Sun, called the Corona, are not stable but are constantly escaping into space. Although the magnetic field of the Sun 'bottles up' some of the hot gases near the solar surface to make spectacular prominences, in other regions the magnetic field opens into interplanetary space and allows the million-degree gases to escape as a Solar Wind.
Within the equatorial region of the Sun, the solar wind travels outwards in a pinwheel- shaped spiral pattern due to the combination of the outward gas motion, at over 400 kilometers/sec (1 million miles/hour), and the rotational motion of the Sun.
Although its normal density is less than 10 atoms per cubic centimeter, because the wind is spread out over such a vast volume of space, it amounts to over 50 billion tons of mass lost per day (50 trillion kilograms/day), mostly in the form of high- speed electrons and protons - the components of the most abundant element in the Sun: hydrogen.
On occasion, and for reasons not fully understood by scientists, the magnetically trapped gases in the Sun's corona can become unstable and get ejected into space as Coronal Mass Ejections, or CMES. These clouds are carried by the solar wind. They are often as big as the Sun itself, and they contain upwards of one billion tons of matter in a single event which may last only a few hours. Traveling at speeds from 450 to 1000 kilometers/sec, the trip from the Sun to the Earth's orbit takes only a few days.
Most of these clouds dissipate quickly and merge into the solar wind while others can remain cohesive, though substantially diluted by the time they reach the Earth. Most of these CMEs never collide with the Earth, but those that do can cause satellite damage and brilliant auroral displays, so their effects are not inconsequential.
Like Stealth Bombers, it is not the ones we can detect on the limb of the Sun that pose a hazard to us here on Earth, it is the ones that are lost in the glare of the solar surface that can potentially reach Earth. NASA has stationed satellites in space between the Earth and the Sun to provide advanced warning for stealthy CME events, but even so, only about 1-2 hours of warning is possible from such distant outposts.