  Using a combination of the operator product and heavy quark expansions, we
resum the leading nonperturbative contributions to the inclusive photon
spectrum in $B\to X_s\,\gamma$ decays. The shape of the spectrum is determined
by a universal structure function, which describes the distribution of the
light-cone momentum of the $b$-quark inside the $B$-meson. The moments of this
function are proportional to forward matrix elements of higher-dimension
operators. As a by-product, we obtain the bound $\lambda_1<0$ for one of the
parameters of the heavy quark effective theory. The integral over the $B\to
X_s\,\gamma$ structure function is related to the shape function that governs
the fall-off of the lepton spectrum close to the endpoint in $B\to
X_u\,\ell\,\bar\nu$ decays. A measurement of the photon spectrum in rare
$B$-decays can therefore help to obtain a model-independent determination of
$V_{ub}$.
