We investigate the potential of lunar occultations for the detection of very faint companions, and in particular for the possibility of detecting extrasolar planets. We review the basic concepts of the method, and discuss the quantities which are relevant for this particular application. The near-infrared range, and in particular the K and L bands (2.2 and 3.6 mu m), offer the best dynamic range. We present results of detailed simulations based on previous experience with lunar occultation events, and taking into account a realistic noise model which includes the effects of detector, lunar background, scintillation. We conclude that lunar occultations at a large telescope (8-10 m class) can detect companions ~5 to ~11 mag fainter than the primary, at distances of order 0farcs01 . The detection is highly asymmetric, with scintillation and photon noise from the central star being the limiting factor in one half-plane of the sky. Although this performance is not strictly sufficient for the direct detection of hot Jupiters, the method can nevertheless provide a valuable check with a relatively simple effort. We provide a list of lunar occultation events of candidate exoplanets visibile from the major observatories in the period 2003-2008. The method would be particularly attractive with large telescopes in the 30 to 100 m class.