The set of all solutions to the homogeneous system of matrix equations (X-T A + AX, X-T B + BX) = (0, 0), where (A, B) is a pair of symmetric matrices of the same size, is characterized. In addition, the codimension of the orbit of (A, B) under congruence is calculated. This paper is a natural continuation of the article [A. Dmytryshyn, B. Kagstrom, and V. V. Sergeichuk. Skew-symmetric matrix pencils: Codimension counts and the solution of a pair of matrix equations. Linear Algebra Appl., 438:3375-3396, 2013.], where the corresponding problems for skew-symmetric matrix pencils are solved. The new results will be useful in the development of the stratification theory for orbits of symmetric matrix pencils.