The finite-element technique of Lysmer and Drake has made possible the study of time-harmonic surface waves in irregular, two-dimensional structures. This paper provides the stiffness and mass matrices necessary for extending their technique to the study of time-harmonic surface waves in irregular, three-dimensional structures. The element stiffness matrix [k] and the element mass matrix [m] are obtained by symbolic integration for an isotropic, rectangular hexahedron; the elements of these 24 × 24 matrices are given in explicit form. In addition, the layer stiffness matrix [K] and the layer mass matrix [M] appropriate for horizontally layered, laterally homogeneous, three-dimensional models constructed from rectangular hexahedra are also given in explicit form. Modifications to both [K] and [M] are described which ensure surface-wave motion in the horizontally layered, laterally homogeneous, three-dimensional structure. Finally, an example is given which demonstrates the correctness of the modified forms of [K] and [M] and, by implication, the correctness of [k] and [m].