  X-ray observations of Seyfert 1 galaxies offer the unique possibility of
observing spectral variability on timescales comparable to the dynamical time
of the inner accretion flow. They typically show highly variable lightcurves,
with Power Density Spectra characterized by `red noise' and a break at low
frequencies. Time resolved spectral analysis have established that spectral
variability on the shortest timescales is important in all these sources, with
the spectra getting softer at high fluxes. Here we present a model that is able
to explain a number of the above mentioned properties in terms of magnetic
flares shining above a standard accretion disc and producing the X-ray spectrum
via inverse Compton scattering soft photons (both intrinsic and reprocessed
thermal emission from the accretion disc and locally produced synchrotron
radiation). We show that the fundamental heating event, likely caused by
magnetic reconnection, must be compact, with typical size comparable to the
accretion disc thickness and must be triggered at a height at least an order of
magnitude larger than its size; the spatial and temporal distribution of flares
are not random: the heating of the corona proceeds in correlated trains of
events in an avalanche fashion. The amplitude of the avalanches obeys a
power-law distribution and determines the size of the active regions where the
spectrum is produced. With our model we simulate X-ray lightcurves that
reproduce the main observational properties of the Power Density Spectra and of
the X-ray continuum short-term variability of Seyfert 1 galaxies. By comparing
them with observations of MGC--6-30-15, we are able to infer that the corona in
this source must have a large optical depth (tau >1.5) and small average
covering fraction.
