  We describe the $B^0$ and $B^0_s$ decays into $J/\psi$ $f_0(500)$ and
$J/\psi$ $f_0(980)$ by taking into account the dominant process for the weak
decay of $B^0$ and $B^0_s$ into $J/\psi$ and a $q \bar q$ component. After
hadronization of this $q \bar q$ component into pairs of pseudoscalar mesons we
obtain certain weights for the meson-meson components and allow them to
interact among themselves. The final state interaction of the meson-meson
components, described in terms of chiral unitary theory, gives rise to the
$f_0(980)$ and $f_0(500)$ resonances and we can obtain the $\pi^+ \pi^- $
invariant mass distributions after the decay of the resonances, which allows us
to compare directly to the experiments. We obtain ratios of $J/\psi$ $f_0(980)$
and $J/\psi$ $f_0(500)$ for each of the $B$ decays in quantitative agreement
with experiment, with the $f_0(980)$ clearly dominant in the $B^0_s$ decay and
the $f_0(500)$ in the $B^0$ decay.
