Aims: We investigate the one-zone SSC model of TeV blazars in the presence of electron acceleration. In this picture electrons reach a maximum energy where acceleration saturates from a combination of synchrotron and inverse Compton scattering losses. Methods: We solve the spatially averaged kinetic equations which describe the simultaneous evolution of particles and photons, obtaining the multi-wavelength spectrum as a function of time. Results: We apply the model to the rapid flare of Mrk 501 of July 9, 2005 as this was observed by the MAGIC telescope and obtain the relevant parameters for the pre-flare quasi steady state and the ones during the flare. We show that a hard lag flare can be obtained with parameters which lie well within the range already accepted for this source. Especially the choice of a high value of the Doppler factor seems to be necessary.