Nanocomposite thin films exhibit interesting optical properties which differ from those of the pure constituents. Effective medium theories are used to model the dielectric function of the nanocomposite materials. We give an introduction to the theories of Maxwell-Garnett, Bruggeman and Ping Sheng, considering spherical and ellipsoidal geometries and taking into account finite size effects. Metal containing amorphous hydrogenated carbon films (a C:H/Me), and metal containing amorphous hydrogenated silicon carbon films (a Si:C:H/Me) are of special interest regarding solar energy applications. Such films are deposited by a vacuum process combining physical vapor deposition (PVD) and plasma assisted chemical vapor deposition (PECVD), and exhibit a granular structure on the nanometric scale. In the case of noble metal doped films, nanometric noble metal clusters are embedded in an amorphous matrix, while in the case of transition metals carbide or alloy clusters can be formed. The optical properties of the nanocomposite thin films are determined experimentally by spectrophotometry, spectroscopic ellipsometry, and in-situ laser reflectometry. The comparison of the experimental results to the effective medium theories illustrates that the Maxwell-Garnett theory can only be applied in the case of small filling factors. The superiority of the Ping Sheng theory with respect to the theories of Maxwell Garnett and Bruggeman can clearly be demonstrated. The correction of the optical constants of metal clusters due to the finite size effect as well as the applicability of the effective medium theories in the case of complex alloy clusters is discussed.