The Sun's magnetic field and solar wind - mainly in the form of electrons and protons coming out of the Sun - protects the entire Solar System by acting as a sort of shield from cosmic rays (very energetic particles and radiation from outer space).
BBC: Viewpoint: The Sun and climate change