When optical stylus sensors are used to measure edged profiles or surfaces with scratches, overshooting phenomena occur sometimes. In the present paper, the overshooting on edged profiles is analyzed in views of reflection and diffraction by an optical ray tracing method. In the ray tracing, reflected beams from all of the three surfaces (upper, lower and side surfaces) of the edge are taken into consideration. In the view of diffraction, the focal point is considered as a beam waist with a diameter derived from Gaussian distribution. The simulation shows that the height of the overshooting has a close relation with the focus error and the height of the edge. It is also shown that the overshooting occurs even though the optical system is perfectly adjusted and it is also demonstrated that the ray reflected from the side surface is one of the main causes of overshooting and the beam waist is another cause of overshooting. Finally, the results of simulation are compared with those of the experiment using a critical angle prism sensor.