It should be noted that the temperature in space can vary greatly. Traditionally it was believed that it is equal to absolute zero i.e. 0 Kelvin or -273,15 degrees Celsius. But in fact, the subject, left in the open space, provided that it is not exposed to the heat radiated by stars, will be cooled (or heated) to a temperature of 2.725 degrees Kelvin or -270,425 degrees Celsius. This is due to the influence of the background radiation.
The background radiation is electromagnetic cosmic radiation with a spectrum characteristic for absolutely black body with a temperature of 2,725 degrees Kelvin. It appeared in the first moments of the Universe, although at the time his temperature was much higher than it is now. This is due to a gradual decrease in the temperature of the photons, a movement which at top speed is the cosmic background radiation. It is distributed relatively evenly, so the difference of the temperature of the cosmic background in different areas of space if is changed slightly. This means that you can take as a basis the temperature of the space is equal to 2.725 degrees Kelvin.
But we must not forget the thermal radiation of stars. Since vacuum is an excellent insulator, and in space without atmosphere and convection of air, it heat up very quickly. The density of the heat flow radiated by the Sun depends on the distance to it. For example, with mercury closest to the Sun planets, it will be 8000 kcal/m*h for Jupiter – 45 kcal/m*h, and for Pluto and only 0.6 kcal/m*h. Near the Ground the temperature is located in the open space of the body, located from direct sunlight, can rise to 473 degrees Kelvin. When approaching the star it will grow.
Thus, the space is hot and cold at the same time depending on what point it is measured. Away from the stars, which almost does not penetrate the heat flow, it would equal approximately 2,725 degrees Kelvin because of the cosmic background radiation evenly spread throughout the available for the study of terrestrial astronomers of the Universe, but when approaching the star will gradually increase.