It has generally been assumed that the emission from the upper atmosphere o
f late-type stars is optically thin. In the present paper we use the Si IV
and C IV resonance Lines to investigate this assumption for the active dMe
star YZ CMI. The significant deviations of the line ratios from their optic
ally thin values, demonstrate that opacity can be quite important particula
rly in the case of stellar flares. These deviations are combined with a met
hod of escape probabilities to derive optical depths of approximately unity
for the lines under consideration. We demonstrate that, if the electron de
nsity in the atmosphere is known, opacity can provide important information
on the linear dimensions of the scattering layer. Using this technique, we
have estimated path lengths of a few kilometers for one of the flares unde
r consideration.