An interesting question!
Preface: I'm not nearly an expert on atmospheric heating. I'll try to analyze the problem from first principles - someone more experienced could do better.
There are not enough gas particles to come into contact with the spacecraft to heat it up.
This seems quite reasonable. Thin, diffuse gasses can be very hot without conducting much heat - particles in the glow discharge in a fluorescent tube lightbulb can exceed 10,000 K, and the glass doesn't even get hot to the touch.
solar radiation is heating up the gas particles, it must also heat up the spacecraft.
Perhaps not! If you think about how the optical properties of gases and spaceships could differ, you can probably come up with a bunch of options. Let's look at some ways:
- Spaceships are often shiny, or at the very least bright white.
For instance, the Apollo command module was coated in terrifically reflective aluminized mylar. Polished aluminum is so perfectly reflective that it's used to make telescope mirrors - it reflects >95% of all light across the spectrum. (Side note: the mylar backing was burned off during the searing heat of re-entry, so capsules in museums aren't very shiny).
You might argue 'ah, but gases are transparent! Surely they won't get hotter than a solid object!' True! But the atoms which comprise the gas are not transparent - and the definition of temperature refers only to the amount of energy that the atoms are absorbing.
Speaking of spectrum, modern thermal control engineering is really fantastic. There are materials with engineered spectral emissivity that reflect the sun's spectrum while emitting in every other wavelength - something like a photographer's notch filter. These can reach almost absolute zero totally passively, even in direct sunlight! (Youngquist et al, Cryogenic Selective Surfaces / "Solar White")
What if that's still not enough? Often a craft can be dunked in white paint and still overheat, especially if there's a lot of power being produced internally. Then we use Multi-Layer Insulation and huge radiators that emit infrared light. Radiators can be made essentially as big as required within the leeward shadow of the craft.
You can see how these are arranged on the ISS - they're almost always edge-on to the sun, and an ammonia loop dumps the ISS' ~300 Kw into them.