A theoretical description of spin current injection from a nonmagnetic layer into a magnetic one is presented, with the main emphasis on the description and determination of the penetration depth of spin current component transverse to the magnetization. This penetration depth also determines the depth of spin transfer torque generation. Physically, the spin current may be driven by an external electric field or by a temperature gradient. To determine the penetration depth we used ab initio calculations of channel and mixing conductances as well as of mixing transmission. The results are then used to determine the second harmonic voltage response, which in turn can be used to determine the penetration depth experimentally.