The history of optics is a very rich field of science. It is possible to find many simple and significant examples of the application and success of the experimental method. Therefore, history of optics is a very good tool to teach students about the way science proceeds and to introduce the right spirit of critical analysis, building and testing of models, etc. Optical phenomena are specially well suited for this because, in fact, optical observations and visual experiments have made science advance in a significant way along different periods of history. In many cases experiments are essentially visual, and quite simple in concept. Besides they are easy to reproduce their experimental setups in classrooms. Also, the intrinsic multidisciplinary character of Optics, which is a subject that has historically influenced in a notorious way fields as art, philosophy, religion and cultural and social studies in general, provides a wide frame that permits to apply these examples to a large variety of learning levels. We present here some ideas about the role that history of optics can play in teaching and show some real examples of its application during the many years that we have been employing it in the context of the Optics School of the University Complutense of Madrid, Spain.