  We consider subdiffusion in a system which consists of two media separated by
a thin membrane. The subdiffusion parameters may be different in each of the
medium. Using the new method presented in this paper we derive the
probabilities (the Green's functions) describing a particle's random walk in
the system. Within this method we firstly consider the particle's random walk
in a system with both discrete time and space variables in which a particle can
vanish due to reactions with constant probabilities $R_1$ and $R_2$, defined
separately for each medium. Then, we move from discrete to continuous
variables. The reactions included in the model play a supporting role. We link
the reaction probabilities with the other subdiffusion parameters which
characterize the media by means of the formulae presented in this paper.
Calculating the generating functions for the difference equations describing
the random walk in the composite membrane system with reactions, which depend
explicitly on $R_1$ and $R_2$, we are able to correctly incorporate the
subdiffusion parameters of both the media into the Green's functions. Finally,
placing $R_1=R_2=0$ into the obtained functions we get the Green's functions
for the composite membrane system without any reactions. From the obtained
Green's functions, we derive the boundary conditions at the thin membrane. One
of the boundary conditions contains the Riemann--Liouville fractional time
derivative, which shows that the additional `memory effect' is created in the
system. As is discussed in this paper, the `memory effect' can be created both
by the membrane and by the discontinuity of the medium at the point at which
the various media are joined.
