The large magnetic "bubble" that surrounds Earth extends 40,000 miles toward the sun and even farther away from it. The magnetosphere traps and diverts particles from the solar wind.