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 , on a wide range of timescales , with Power Density Spectra characterized by ‘ red noise ’ and a break at low frequencies . On the other hand , 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 ( in the 2-10 keV band , typically ) , while the reflection component and the iron line often exhibit a complex behaviour . 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 of 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 fundamental property of our ‘ thundercloud ’ model is that the spatial and temporal distribution of flares are not random : the heating of the corona proceed 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 . Due to the feedback effect of the X-ray radiation reprocessed in the disc , larger active regions produce softer spectra . 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 accretion disc corona in this source must have a large optical depth ( \tau _ { T } \ga 1.5 ) and small average covering fraction .