In General Relativity, spacetime is modeled as a Lorentzian manifold and light rays are modeled as lightlike geodesics. If there are two or more future-oriented light rays from a timelike curve (worldline of a light source) to a point (observation event), one speaks of multiple imaging by the gravitational lens effect. This means that an observer at the observation event sees two or more images of the light source. In these lectures I demonstrate how a variational principle (Fermat's principle) can be used for investigating the gravitational lens effect. Among other things, I will discuss the notion of conjugate points and the notion of cut points and I will outline their relevance in view of gravitational lensing.