To some extent this may be a case of the accepted usage in the field in question, which I assume is chemistry, or perhaps physics.
I say this because, just based on my ordinary understanding of the noun, "optically thin gas," I would say you do in fact need the indefinite article ("an") in both of your examples. And I would say that, if you take out the "an," you want to make "gas" plural ("gases").
So what I'm saying is, based on my non-specialist understanding of what these sentences say, you would always want to say "a" or "the" with the singular ("optically thin gas") and omit the article with the plural ("optically thin gases").
Another way of putting this is that it depends on whether, in your field or context, "gas" is being used an a countable or uncountable noun. If it's a countable noun, then you'd want to use an article with the singular, and no article with the plural. If it's an uncountable noun, you would omit the article in the singular. Sometimes nouns can be both countable and uncountable, with subtle differences in meaning. If this is a case like that, then when you use the article, you are referring to the countable noun (a specific gas, one of many gases that can be counted). When you omit the article, you are referring to the uncountable noun (gas in general, like "love" or "money" or "truth" or "beauty" or "justice").