The impact of resonance magnetic perturbations (RMP) on the structure of the edge transport barrier has been studied. A new model for the density pump-out mechanism during the stochastization of the plasma edge is proposed. The observed phenomena are explained as a result of the impact of the ambipolar electric field, which is modified during RMP, on the particle fluxes in the pedestal region. It is demonstrated that the rise of the particle fluxes inside the transport barrier leads to the pump-out effect on density, while the pedestal temperature increases in spite of the big electron heat conductivity in the stochastic magnetic field. The analytical approach is supported by results of simulations with the B2SOLPS5.2 2D transport code which uses a full description of particle sources and transport phenomena in the pedestal region. Simulations are performed for ASDEX Upgrade and MAST configurations for various values of electron stochastic conductivity. The radial electric field with RMPs is predicted to be less negative than without RMP. The density drop and temperature rise in the pedestal region are observed in accordance with the experimental results. Generation of toroidal rotation in the cocurrent direction is predicted. Extrapolations to ITER are discussed.