The layer which protects the earth is referred to as magnetosphere.
Magnetosphere is termed as the region of space which surrounds astronomical object by way of magnetic fields.
They create planets which generates planets in magnetic field which include fields where they can occur in stars through interaction of plasma.
Magnetosphere blows away particles from the earth and also from the sun.