The bending moments on the left and right faces of the beam element create normal stresses σ that are linearly distributed over the depth of the cross section.

Derivation of shear stress formula