Amplified electromagnetic fields generated by a surface of finitely sized metal or dielectric particles are calculated. Regular arrays of particles produced by lithographic techniques and stochastic particle distributions that occur, e.g., in island films, are discussed. Retarded dipolar interactions between the particles are explicitly taken into account. Particles of finite size are considered for which dynamic depolarization and radiation damping effects are important. Limits of validity of the present approach are indicated. The total electromagnetic field from the surface is calculated by superposition: Scalar potentials characterizing a single particle are convoluted with a distribution function describing the particle positions. The surface Hertz vector is obtained from the single-particle Hertz vector by convolution with a two-dimensional Shah function representing the array or with the autocorrelation function of the stochastic surface. A plane-wave description of the dipolar fields is used, whereby the convolution is transformed into a simple multiplication in Fourier space. Cylindrical, general spheroidal, and spherical shapes are considered for the individual particle. Particle dipole moments are obtained by a self-consistent procedure. Dipolar interactions result in shifts and broadening of the particle plasmon resonances, which are responsible for the local intensity enhancement. A set of universal curves is given from which shift and broadening can be calculated for particles of all sizes and shapes. Extrema in the dipolar interactions arise when grating orders change from radiative to evanescent character. The strong variation of the Raman enhancement with angle and wavelength in the vicinity of these extrema is clearly predicted from the Hertz-vector calculation. The formalism described permits one to calculate electromagnetic properties of the surface and enhancement factors for any electromagnetic process occurring at or near the surface. As examples, the calculation of reflectivities for s-and p-polarized excitation and surface-enhanced Raman-scattering cross sections are discussed.