The vast majority of the Solar System consists of a near-vacuum
How the interplanetary medium interacts with planets depends on whether they have magnetic fields or not. Bodies such as the Moon have no magnetic field and the solar wind can impact directly on their surface. Over billions of years, the lunar regolith has acted as a collector for solar wind particles, and so studies of rocks from the Moon's surface can be valuable in studies of the solar wind.
High energy particles from the solar wind impacting on the Moon's surface also cause it to emit faintly at X-ray wavelengths.
Planets with their own magnetic field, such as the Earth and Jupiter, are surrounded by a magnetosphere within which their magnetic field is dominant over the Sun's. This disrupts the flow of the solar wind, which is channelled around the magnetosphere. Material from the solar wind can 'leak' into the magnetosphere, causing aurorae and also populating the Van Allen Belts with ionised material.