I mean what is the relationship between the empty space between stars such that it contains sparse distribution of gas and our our inability to see the rims of our galaxy. I searched too long time to get an answer but I did not get any thing.
$\begingroup$ Not sure I understand your question, what edge you are referring to. Maybe you can give us slightly more background on what you mean in an edit to this question. Do you assume that our Galaxy has some kind of sharp edge where in the inside there is some gas, and outside in the intergalactic space there is not? $\endgroup$– planetmakerSep 11, 2022 at 11:22
$\begingroup$ @planetmaker that is exact what I mean . From our position inside the Milky Way Galaxy, we cannot see through to its far rim (at least not with ordinary light) because the space between the stars is not completely empty. It contains a sparse distribution of gas (mostly the simplest element, hydroge $\endgroup$– yh_2004Sep 11, 2022 at 11:29
$\begingroup$ Oh we DO see to its rim (not every direction, of course) - but that's similar to how here on Earth and the atmosphere: we see the atmosphere, but not the rim - there simply is none, it gets thinner and thinner the further we go. And we don't see it at all where Earth is itself (thus where most stars especially in the Galactic center direction are and thus somewhat hide the far edge of the milkyway) $\endgroup$– planetmakerSep 11, 2022 at 12:00
Mixed in with the interstellar gas (which has almost no effect on visible-wavelength light by itself) are dust grains, which scatter and absorb light. Because the density of gas and dust increases as you get closer to the center of the galaxy, looking in the direction of the center of the galaxy (or nearby directions) means trying to look through a lot of dust -- more and more if you consider trying to see things farther and farther away from us -- and this ends up blocking most of the light. In visible-wavelength light, we can't even see the central regions of the galaxy, let alone the far side of the disk beyond the center.
But if you look in the opposite direction, you're looking in a direction where the density of (gas and) dust gets lower the further out you go and where the "rim" of the galaxy is closer to us. So it's generally possible to see the near "rim" of the galaxy.
(With the caveat that galactic disks -- including our own -- do not have "rims" in the sense of sharp edges.)