The original question was: What might be the state of matter in [interstellar space]. Average temperature is 2.7K , so all the gases like hydrogen, helium should be in liquid or solid state?
Physicist: Matter in deep space tends to take the form of gas. Liquids basically don’t happen, and solids are pretty rare. The cosmic microwave background ensures that everything is at least as hot as about 2.7K, but in general the gases we see out there are quite a bit hotter. Fortunately, there’s so little of it that you’d barely notice.
For example, in the core of the Orion Nebula the temperature of the gas is around 10,000K, but even if you were there your biggest problem wouldn’t be getting burned, it would be freezing to death. Also suffocation. Really, if you’re going to travel in space at all, bring a spacesuit.
Temperature is a measure of the average random speed of a material (technically, it’s the “variance” of the velocities). That “random” bit is important. For example, the air you’re (hopefully) breathing isn’t sitting still, it’s moving every-which-way at around half a km per second. Air bounces around so much that it doesn’t get very far (about 1 ten millionth of a meter before it gets bounced), but it’s all still moving pretty fast.
By comparison, Halley’s comet is moving at a few dozen km/s (it varies between about 1 km/s and 50 km/s). However, it’s frozen because that movement isn’t random. Its atoms are all moving really fast, but they’re all moving together.
Here comes the point. In deep space you mostly find individual atoms cruising along at high speeds. In order to define a temperature you look at lots of atoms passing through a region and see how random those trajectories are. Typically: they’re very random and very fast, so the temperature of those gases is thousands of degrees Celsius (or Kelvin or Fahrenheit for that matter).
It’s not unusual for things to be randomly traveling through space really fast: space is full of stuff taking forever to go from nowhere to nowhere through nothing at break-neck speeds. Generally, unless there’s a good reason to do otherwise, the individual atoms in space are traveling in every-which-way. A “good reason” is often running into something, or being caught up in an accretion disk. The majority of molecules in deep space are traveling in a straight line, very fast, without (strongly) interacting with anything else for years at a time.
A natural question to ask is: Isn’t space cold? If this interstellar gas is so damnably hot, then why doesn’t it cool off? The answers are: “yes it is” and “you have to think about why things cool off”. Light is created by accelerating charges. Traveling in a straight line involves no acceleration. If things bounce off of each other a lot, then they change direction a lot and that involves (for lack of a better word) a lot of accelerating.
This has nothing to do with either the spirit or letter of the question, but one of the most terribly cool things ever is that entire stars obey the same rules; they travel along at high speeds without interacting with anything else for huge periods of time. While atoms scatter by bouncing off of each other, stars interact with each other through their gravity (it’s very, very rare for stars to actually run into each other). If you stand back far enough, you find that the stars in a galaxy act a lot like a gas. You can even describe the “temperature” of a galaxy and talk about the movement of its stars in terms of thermodynamics. For example, “hot galaxies” are those with lots of randomly moving stars, and these galaxies literally evaporate (eject stars into inter-galactic space) and “cool” as a result. As they “cool” the randomness of their remaining stars’ movements decrease and the galaxy itself tends to contract.