The Gutzwiller trace formula is extended to include diffraction effects. The new trace formula involves periodic rays which have non-geometrical segments as a result of diffraction on the surfaces and edges of the scatter.