<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->
When methane reacts with chlorine, a substitution reaction occurs and the product obtained is chloromethane.
<!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}-->
CH4 + Cl2 → CH3Cl +HCl
But the reaction doesn't stop here. It proceeds till all the hydrogens in the methane get replaced by chlorine atoms. This means that we can get chloromethane, dichloromethane, trichloromethane or tetrachloromethane.
CH3Cl + Cl2 → CH2Cl2 + HCl
CH2Cl2 + Cl2 → CHCl3 + HCl
CHCl3 + Cl2 → CCl4 + HCl