We derive an expression for the inverse longitudinal dielectric function epsilon(-1)(k,omega) of random system of identical spherical particles with dielectric function epsilon(1)(omega) in a host with dielectric function epsilon(2)(omega). A spectral representation allows us to separate geometrical and material effects by writing epsilon(-1)(k,omega) in terms of a spectral function, which depends only on the wave vector k and the geometry of the system. Multipoles of arbitrary order are included. Using a mean-field theory and introducing the two-particle correlation function, we carry out a configuration average and find a simple result for the spectral function. From the loss function Im[-epsilon(-1)(k,omega)] we calculate the energy loss probability per unit path length for fast electrons passing through a system of colloidal aluminum particles.