The light we receive from the stars originates in the stellar atmosphere - the outer regions of the star. The stellar atmosphere is usually measured in terms of optical depth, where:
Optical depth is defined as the negative natural logarithm of the fraction of radiation (e.g., light) that is not scattered or absorbed on a path....... Wikipedia.
Typically the stellar atmosphere is considered to extend to optical depths of roughly 100-1000, but most of the star's light comes from an optical depth of about 2/3. Stellar atmospheres are very tenuous at those depths, with densities 5 orders of magnitude or so less than the density of Earth's atmosphere at the surface.