Astronomical spectra taken with ground‐based telescopes in the near-IR spectral region are affected by strong absorptions due to molecules in the Earth’s atmosphere, particularly CO₂ and H₂O. These features need to be removed in order to reveal the true spectrum of the object being observed. The traditional technique for doing this is to observe a standard star with a relatively featureless spectrum (a smooth spectrum standard) and divide the observed spectrum of the object by that of the standard. This technique has a number of practical difficulties but is also fundamentally flawed. Even with a perfectly smooth spectrum standard observed at an identical air mass to the object, this technique does not, in general, reproduce the spectrum of the object that would have been observed in the absence of the Earth’s atmosphere. The problem arises because of the presence of high‐resolution structure in the molecular absorption features, generally on a finer scale than the resolution of the observed spectrum. The transmission of the Earth’s atmosphere for any spectral bin then depends on the unresolved spectral structure of the light being transmitted and cannot be represented by a unique value derived from the standard star, as the traditional technique assumes. We use high‐resolution line‐by‐line radiative transfer models to quantify these effects for two cases: observations of a solar‐type star, and observations of the planet Mars. For a solar‐type star, application of the traditional technique causes errors of a few percent in the vicinity of strong atmospheric absorption features. The case of the planet Mars is an extreme case, since Mars has the same CO₂ absorption features as the Earth’s atmosphere. Our simulations show that applying the traditional astronomical technique to ground‐based spectra of the planet Mars leads to systematic errors of up to 50% in the vicinity of the strong CO₂ absorption features. High‐quality IR spectroscopy with ground‐based telescopes requires an improved technique to handle the absorption in the Earth’s atmosphere. We outline a possible approach based on the use of radiative transfer models for the Earth’s atmosphere. We note that in general it is not possible to correct observed spectra for atmospheric absorption. However, a forward‐modeling approach can be used in which a model spectrum for the object is generated, atmospheric transmission effects added, and the result compared with the observed spectrum. We present a demonstration of the ability of a model to accurately represent the Earth atmosphere transmission in the J band.