please inform about your configration to get a appropiate answer. regarding spikes it can occur due to many reasons. like magnetic, electric or operational.
as also told by direct e-mail the combined effect of finite slippage, non uniform bunch length and randomness of the phases of the spontaneous emission seed are the causes of the spikes.
If the undulator were infinitely long the radiation bunch would cover the entire length of the bunch so spiking behaviour would appear, as it happens in the case of single slice operation. Namely bunch length slightly less than the slippage length.
The ratio between the slippage and bunch lengths is indeed a measure of the "locked" longitudinal modes by the FEL interaction in the electron bunch, so when the field spans over an entire bunch lengths puts all these modes in phase. When this does not happen there are many locked mode collections competing each other and leading to the spiking behaviour.
A simple derivation is contained in Dattoli, Labat,...Comparison between Fel and comparison laser Sources...
The answer to your question very much depends on the actual FEL configuration. As it was pointed out, in SASE (Self Amplified Spontaneous Emission) type the "spikes" are inevitable due to the way the lasing starts (from shot noise).
One way to avoid it is to use the technique called "seeding" and to use well defined lasing starting conditions. Unfortunately this does not work well for short wavelengths (X-rays) since there is no easy way to generate this high quality seeding electromagnetic wave.
Finding a solution to this is a very hot topic, especially in XFEL community. There are several methods proposed to overcome these difficulties including HGHG, EEHG etc.
Some useful reading material can be found in the FEL conference contributions. A prepress of this year's FEL conference proceedings can be found here: