When a current flows through a heavy metal (HM), the spin of the current carriers is polarized by the spin Hall effect (SHE). In a junction of a HM and a ferromagnetic metal (FM), the spin current flows into the FM from the HM and gives spin-transfer torque to the magnetic moments of the FM. We calculate the spin current in a layer of HM/FM with the SHE. We use a spin-resolved electrochemical potential including the SHE in the calculation of the spin current. The spin current flowing into the FM depends strongly on the thickness of the HM.This work was supported by JSPS KAKENHI Grant Number JP20H0260