The transfer of polarized radiation in spectral lines: Solar-type stellar atmospheres