A method is presented for measuring CH4/CD4 fluxes in fusion experiments from molecular CH or CD bands around 431 nm in the visible spectrum. These are prominent features in the spectra of many tokamaks with carbon limiters. The molecular bands have been modelled by computer programs on the basis of theoretical data for these molecules and of detailed analyses of CH and CD spectra, emitted both by microwave discharges and by tokamak plasmas. As an immediate application, the H/D isotope ratio has been measured in ASDEX from the relative intensities of CH and CD band heads. For analysis of the absolute molecular band emission, the break-up of methane in tokamak plasmas has been calculated including possible transport losses, and the different excitation mechanisms have been studied eventually leading to the emission of the observed CH and CD photons. This allows calculation of the number of CH4/CD4 dissociation events per CH/CD photon for a realistic tokamak situation. The results are in good agreement with experimental investigations and yield almost-equal-to 0.05 for the methane influx relative to deuterium in a typical JET carbon limiter case.