The mechanism and geometry of force measurement with the atomic force microscope are analyzed in detail. The effective spring constant to be used in force measurement is given in terms of the cantilever spring constant. Particular attention is paid to possible dynamic effects. Theoretical calculations show that inertial effects may be neglected in most regimes, the exception being when relatively large colloidal probes are used. Model calculations of the effects of friction show that it can cause hysteresis in the constant compliance region and a shift in the zero of separation. Most surprising, friction can cause a significant diminution of the measured precontact force, and, if it actually pins the surfaces, it can change the sign of the calibration factor for the cantilever deflection, which would cause a precontact attraction to appear as a repulsion. Measurements are made of the van der Waals force between a silicon tip and a glass substrate in air. The evidence for friction and other dynamic effects is discussed. Interferometry is used to characterize the performance of the piezoelectric drive motor and position detector used in the atomic force microscope. It is shown that hysteresis in the former, and backlash in the latter, preclude a quantitative measurement of friction effects. The experimental data appear to underestimate the van der Waals attraction at high driving velocities, in qualitative agreement with the model friction calculations.