Temperature scale in space as leaving Earth Is there a simple formula (or chart) to determine the decrease in temperature as you are leaving Earths “near” space and going further into space? (Providing you are not going toward the sun or other celestial bodies). I understand the temperature of space near Earth is roughly 50F or 283K. I understand in deep space the temperature is roughly -454F or 3K. I also realize that the atmosphere must continue to thin for temperature to continue to drop. I’m trying to find out at what rate space would cool when moving away from Earth (or even other celestial bodies). Thank you.
 A: Not really. The outermost layers of Earth's atmosphere (the exosphere) are extremely hot, but so thin that they have essentially no effect on the temperature of any solid body.
We design spacecraft, and parts thereof, to run hot or cold as required. Different coatings have different balances of absorption of sunlight versus radiation of infrared. Parts of spacecraft that are shielded from sunlight can get very cold indeed: instruments on the cold side of the James Webb telescope operate at -234°C without refrigeration.
A: Thermal engineering is a big deal for satellites, but not so much because the temperature is hot or cold in space, but because in vacuum absorbing and emitting radiation dominates.
If you look for graphs of temperature vs altitude you will see that it gets "hot" in the thermosphere, or exosphere like 1200 K, but the density of gasses  is also very low. So the high temperature is related to the long mean free path and high velocity of the molecules, but is not indicative of the heat transfer from the temperature of environment to the spacecraft. It does cause some drag, and there can be a lot of atomic oxygen that is very reactive, but doesn't really heat the spacecraft even for normal LEO orbits, much less MEO or GEO orbits.
So for heat transfer you have 3 choices, conduction, convection, and radiation. The first two are largely negligible for spacecraft except maybe for things like reentry. So for your calculations really want to want to understand is how things heat and cool radiatively.
Everything radiates due to its temperature according to the black body spectrum. However, how well is radiates is determined by a parameter called emissivity. Good absorbers are typically good radiators. You can absorb the visible light of the sun (black body temperature ~ 5500 K) and if you are 300K like the earth, will radiate back in the infrared around 10 um (the peak of the black body spectrum for something around 300k). One of the reasons the earth temperature is around 300K is that radiation from the sun to the earth and the radiation from the earth to the sun are near equilibrium. You can see how this works in the Stefan–Boltzmann lawWikipedia article.
So for your question on how to calculate. The sunlight in space near the earth is about 1300 W/m2. And you would know how reflective and absorptive your satellite is depending to the coatings on it. Then you would also calculate how much the satellite would radiate out into space. If you have a battery or power source inside the space craft you would also figure out how much heat load that would contribute.  If you go behind the earth, then you would not be heated by the sun (but you would be getting some heat from the earth) and you would likely cool down as you radiate energy into space. A lot of this also depends on the geometry of your space craft so to get exact answers usually requires a computer model, but you can get a rough idea doing simpler calculations if you try to keep the geometry simple.
A: To answer this question one must distinguish between the temperature of the dilute gas filling a volume of space in the upper atmosphere or beyond, and the equilibrium temperature of a solid object in that region.
For an everyday experience illustrating this phenomenon, consider the experience of burning onesself by touching a hot piece of metal that has been left out in the sun on a sunny day, even though the air temperature is less than body temperature. The thermal radiation from the sun has heated the metal to its equilibrium temperature, at which the sum of incoming radiative power, plus incoming conductive and convective heat transfer from the air and ground, minus reflected radiative power, minus outgoing radiative power, minus outgoing conductive and convective heat transfer to the air and ground, equals zero. If the metal was in the shade all day, it would have equilibrated to the temperature of the air, but since it is in direct sunlight it is hot enough to burn you, even in the dense, relatively cool lower atmosphere.
As one increases in elevation into more and more rarified atmosphere, then into the heliosphere (solar wind and other particles propelled outward from the sun), then, far beyond the orbit of the outer planets, into the interstellar medium, the difference between the temperature of the dilute gas and the equilibrium temperature of a dense body at that location becomes more and more pronounced. Furthermore, the temperature of the dilute gas tends to be extremely high because of interaction with high energy particles and ionizing radiation. These high energy interactions are ultimately traceable all the way back to the nuclear furnace of the sun, or, in the interstellar medium, of distant stars and ancient supernovae.
Rough benchmarks for the dilute gas temperature, with my rougher-still understanding of the reason for the temperature:

*

*Atmosphere: about $250 K$ to $300 K$ - the temperature of the planet

*Thermosphere: order of $10^4 K$ - rarified atmosphere heated by contact with solar wind and high-energy radiation.

*Heliosphere: order of $10^6 K$ - the temperature of the sun's corona (which is itself about an order of magnitude hotter than the light-emitting surface of the sun). Since the gas ejected by the sun needs to do negligible work to expand against the vanishingly small pressure of the interstellar medium, it is not cooled noticeably by adiabatic expansion, but follows $P \propto 1/V$ with $T$ constant, for pressure P, volume V.

*Interstellar medium: order of $10^4 K$ to $10^5 K$ - most of this (extremely dilute) gas was originally emitted from stars at order of $10^6 K$, but it is sufficiently ancient that it has cooled by photon emission. When molecules impact one another, promote electrons to higher energy levels, and then shed the impact energy as light as the electrons return to ground states. Some photons are re-absorbed by molecules in the ISM, but others escape the galaxy.


These dilute gas temperatures are, as mentioned, almost completely decoupled from the equilibrium temperature of a solid in such a region, for which it is safe to assume a pure vacuum with undefined temperature, heated and cooled exclusively by radiation.
This equilibrium temperature is approximated by the blackbody temperature of a body with net zero power flux - that is, it takes in as much radiative power from the sun as it radiates out by blackbody radiation.
To calculate this, we need the power output of the sun, the distance to the sun, and the Stefan-Boltzmann Law. Since all we want is the equilibrium temperature, not the power flux at any given temperature, both area and emissivity drop out as long as a body has about as much surface area exposed to sunlight as it has in shadow and is not rotating quickly. Incident radiative power varies as the $-2$ power of distance, while temperature (absolute temperature, measured in Kelvins) varies with the $1/4$ power of radiative power. Composing, we get equilibrium temperature which varies roughly as $T \propto r^{-0.5}$, for distance $r$ from the sun, $r \gg r_\odot$.
Empirically: the average temperature of the Moon is about $253 K$, while the average temperature of Mars is about $213 K$, a ratio of $.84$. Mars is about $1.5$ times farther from the sun than the Moon; $1.5^{-0.5} = 0.82$. Titan, $9.5$ times farther from the sun than is the Moon, has an average temperature of $92 K$, of which $10 K$ is attributed to greenhouse effect; $253K \times 9.5^{-0.5} + 10 K = 92 K$, exactly as measured.
Very far from the sun, the total power flux is so small that we need to include in our calculations sources of power that we were previously able to dismiss as so small relative to the sun's that they were indistinguishable from zero, like the light of distant stars and the cosmic microwave background. The latter sets a minimum equilibrium temperature of 2.7 K, even in the blackest depths of the intergalactic void.
