A model is proposed to explain temporal patterns of activity in a class of periodically exploding Strombolian-type volcanos. These patterns include major events (explosions) which follow each other every 10-30 minutes and subsequent tremor with a typical period of 1 second. This two-periodic activity is thought to be caused by two distinct mechanisms of accumulation of the elastic energy in the moving magma column: compressibility of the magma in the lower conduit and viscoelastic response of the almost solid magma plug on the top. A release of the elastic energy happens when a stick-slip dynamic phase transition in a boundary layer along the walls of the conduit occurs; this phase transition is driven by the shear stress accumulated in the boundary layer. The first-order character and intrinsic hysteresis of this phase transition explains the long periods of inactivity in the explosion cycle. Temporal characteristics of the model are found to be qualitatively similar to the acoustic and seismic signals recorded at Karymsky volcano in Kamchatka.