Considering soil layering is a crucial and effective issue in investigating the seismicity of structures. However, previous studies have not examined the presence of a rock layer in soft soil. So; in the present paper, the effect of the rock layer in soft soil on the forces and displacements created in the low-and mid-rise steel moment frame was investigated. Thus, several numerical calculations were performed on 12 different sizes of rock layers at three different depths. Finite element models were analyzed using ABAQUS Software and considering the interaction of structure and soil. Results of the studies show that the value of force and displacement depends on the frequency of the structure, the frequency of the soil-structure system, dominant earthquake frequency, the rock weight, and the stiffness of the structure. Two new parameters are defined that have a linear relationship with force and displacement. Results show that the thickness and length of the rock layer affect the value of force and displacement. Also, the presence of a rock layer in the soil may not be reliable and may increase the shear force by up to 27%, the axial force by up to 10%, and the moment by up to 19%. The effect of the presence of a rock layer on the displacement is more than on the force and increases the lateral displacement by up to 31% and the relative vertical displacement of the foundation by up to 59%.