In this paper, we consider the longitudinal and transversal vibrations of the masonry beams and arches. The basic motivation is the seismic vulnerability analysis of masonry structures that can be modeled as monodimensional elements. The Euler–Bernoulli hypothesis is employed for the system of forces in the beam. The axial force and the bending moment are assumed to consist of the elastic and viscous parts. The elastic part is described by the no-tension material, i.e., the material with no resistance to tension and which accounts for the cases of limitless, as well as bounded compressive strength. The adaptation of this material to beams has been developed in Orlandi (Analisi non lineare di strutture ad arco in muratura. Thesis, 1999) and Zani (Eur J Mech A/Solids 23:467–484, 2004). The viscous part amounts to the Kelvin–Voigt damping depending linearly on the time derivatives of the linearized strain and curvature. The dynamical equations are formulated, and a mathematical analysis of them is presented. Specifically, following Gajewski et al. (Nichtlineare Operatorgleichungen und Operatordifferentialgleichungen. Akademie-Verlag, Berlin, 1974), the theorems of existence, uniqueness and regularity of the solution of the dynamical equations are recapitulated and specialized for our purposes, to support the numerical analysis applied previously in Lucchesi and Pintucchi (Eur J Mech A/Solids 26:88–105, 2007 ). As usual, for that the Galerkin method has been used. As an illustration, two numerical examples (slender masonry tower and masonry arch) are presented in this paper with the applied forces corresponding to the acceleration in the earthquake in Emilia Romagna in May 29, 2012.