When a planet crosses in front of its star, it blocks part of the stellar disk. The transit depth is roughly (Rp/R★)²; limb darkening and grazing geometry change the observed curve.
Different gases absorb different wavelengths. Light that skims the upper atmosphere is attenuated by an optical depth τ; the apparent radius increases in absorbing bands.
Warmer, lower-gravity atmospheres have larger pressure scale heights H = kT/(μmHg). More extended atmospheres create stronger spectral features, all else equal.