  We consider the decay of a heavy flavour into an inclusive hadronic state X
of invariant mass m_X small with respect to its energy E_X, m_X << E_X. The
electron spectrum and the hadronic mass distribution in semileptonic b -> u
decays, or the photon spectrum in b -> s gamma decays, all require, close to
their endpoints, a control over this region. This region is affected both by
non-perturbative phenomena related to the Fermi motion of the heavy quark and
by perturbative soft gluon radiation in the final state (Sudakov form
factor).Fermi motion can be described by the shape function f (m*), which
represents the distribution of the effective mass m* of the heavy quark at
disintegration time. We perform a factorization with a simple technique in
order to consistently separate perturbative from non-perturbative effects. We
find that the shape function, contrary to naive expectations,is not a physical
distribution, as it is affected by substantial regularization scheme effects,
controlling even the leading, double-logarithmic term. It factorizes, however,
the bulk of non-perturbative effects in lattice-like regularizations. Some
non-perturbative effects are present in the coefficient function even at
leading twist, but they are expected to be suppressed on physical grounds.
Finally, we clarify a controversial factor of 2 in the evolution kernel of the
shape function.
