Inelastic scattering of fast electrons from void embedded in a surrounding metal has been calculated. A constant dielectric material inside the void is explicitly considered. We have calculated all the collective modes of the system within an improved hydrodynamic model and have obtained dispersion relations for the surface and bulk plasmons. The incident electrons have been treated classically. We have compared our results with electron-energy-loss experimental data from helium bubbles in aluminum and we conclude that the structure of absorption spectra depends critically on the dimension of the cavity and on the impact parameter. A similar behaviour was previously observed in the case of metallic spheres. © 1990.