We calculate the single-particle spectral function for the one-band Bose-Hubbard model within the random phase approximation (RPA). In the strongly correlated superfluid, in addition to the gapless phonon excitations, we find extra gapped modes which become particularly relevant near the superfluid-Mott quantum phase transition (QPT). The strength in one of the gapped modes, a precursor of the Mott phase, grows as the QPT is approached and evolves into a hole (particle) excitation in the Mott insulator depending on whether the chemical potential is above (below) the tip of the lobe. The sound velocity of the Goldstone modes remains finite when the transition is approached at a constant density, otherwise, it vanishes at the transition. It agrees well with Bogoliubov theory except close to the transition. We also calculate the spatial correlations for bosons in an inhomogeneous trapping potential creating alternating shells of Mott insulator and superfluid. Finally, we discuss the capability of the RPA approximation to correctly account for quantum fluctuations in the vicinity of the QPT.