The problem of line formation in stellar atmospheres is studied in terms of contribution functions. The correlation between the contribution from atmospheric layers to an emergent quantity and the line formation process is explored in the case of absorption lines for unpolarized light, while the case of polarized light will be considered in a forthcoming paper. We use four contribution functions derived from two (differential and integral) formal solutions to the radiative transfer equations for emergent specific intensity and line depression respectively. Two kinds of model atmosphere are employed to investigate the wavelength dependence of these contribution functions. One is artificial, and gives the restricted distribution of line absorbers in tenuous layers, while the other represents a more realistic stellar atmosphere in which line absorption and emission are ubiquitous. It is found in the artificial model that the line formation region is indicated only by the levels that provide a dominant contribution to the line core that is distinguishable from the contribution to the continuum, for the contribution functions that describe the contribution of the layer to the specific intensity at the surface. For those functions that denote the contribution to line depression, the formation layers can be more directly determined, but sometimes the original meaning of the contribution function is lost. Thus the depth distribution of the contribution and the line formation process should be carefully connected. For the contribution functions calculated in both types of model, they show a common feature: around the line centre there is a formation core the main contribution region of which delineates the line core formation region. Its width is related to a depth-averaged Doppler width, and all wavelength points within the core form in the same region. For the Mg I 5172.7 line forming in the solar umbral atmosphere, the formation core forms separately from the far wings, mainly as a result of the solar temperature stratification. Finally, the line core formation region is not influenced by the distribution of line-of-sight velocities, while the formation region of the line wings is affected by these velocities.