  We investigate the dynamic structure factor of a system of Bose particles at
zero temperature using quantum Monte Carlo methods. Interactions are modeled
using a hard-sphere potential of size $a$ and simulations are performed for
values of the gas parameter $na^3$ ranging from the dilute regime up to
densities $n$ where the thermodynamically stable phase is a solid. With
increasing density we observe a crossover of the dispersion of elementary
excitations from a Bogoliubov-like spectrum to a phonon--maxon--roton curve and
the emergence of a broad multiphonon contribution accompanying the
single-quasiparticle peak. In particular, for $na^3=0.2138$, which corresponds
to superfluid $^4$He at equilibrium density, the extracted spectrum turns out
to be in good agreement with the experimental energy--momentum dispersion
relation in the roton region and for higher momenta. The behavior of the
spectral function at the same density in the stable solid and metastable gas
phase above the freezing point is also discussed.
