Alkanes react with chlorine gas in presence of UV light or diffused sunlight or at a high temperature (573-773 K) to give a mixture of alkyl halides.
Chlorination of methane:

Tetrachloromethane is a major product when excess of chlorine is used. Chloromethane is obtained as major product when excess of methane is employed.