A stellar occultation occurs when a solar system object passes in front of a distant star. The light curves resulting from stellar occultations can reveal many aspects of the obscuring object. For airless bodies, the diffraction light curve specifies the object's size, distance and, if several chords are observed, shape. Occultation light curves are especially sensitive to the presence of atmospheres; the refraction light curve is a function of the atmosphere's density, pressure, and temperature profiles. The goal of this paper is to develop a practical algorithm to model the simultaneous effects of diffraction and refraction for objects in which both phenomena are observable. The algorithm we present is flexible: it can be used to calculate light curves by objects with arbitrary shapes and arbitrary atmospheres (including the presence of opacity sources such as hazes), provided that the atmosphere can be represented by a thin screen with a phase delay and an opacity defined at each location in the screen. Because the algorithm is limited at present to thin atmospheres (in which rays from a star are bent but undergo virtually no translation as they pass through an atmosphere), the gas giants, Earth, Mars, and Venus are not treated. Examples of stellar occultations are presented for round or irregularly shaped objects having thin atmospheres of various column densities.