In this paper we describe a practical method for determining crustal structure by comparing observations of teleseismic body waves with synthetics constructed using generalized ray theory. Layered crustal structure beneath a seismic station strongly influences teleseismic body waves arriving in the 50 s or so after the initial P; however, the effect of crustal structure differs significantly for vertical-component and radial-component records. For any proposed crustal structure, we develop an approximate theoretical formulation to predict the radial-component seismogram as a function of the vertical-component observations. Then, we compare the observed and predicted radial-component seismograms in the time domain, and vary the proposed crustal structure using a grid-search scheme until we obtain an optimum match. The theoretical approximation is complete to second order in the reflection and transmission coefficients, and is accurate to within a few per cent for modelling teleseismic waveforms. We demonstrate the feasibility of this second-order, radial-vertical comparison (SORVEC) method by testing it on synthetically generated waveforms having complicated source properties and significant levels of background noise. We illustrate the application to real data by determining the crustal structure beneath two seismic stations in Tibet, LZH and AMDO. Beneath station LZH, the crustal thickness is about 65 km. Beneath station AMDO, the crustal thickness is about 75 km, and there is a low-velocity layer in the lower crust.