Source function expansion method for radiative transfer in a two-layer slab