A free-radical substitution reaction is likely to be responsible for the observations. The reaction mechanism of a reaction like this can be grouped into three phases:
Initiation; the "light" on the mixture deliver sufficient amount of energy such that the halogen molecules undergo homologous fission. It typically takes ultraviolet radiation to initiate fissions of the bonds.
Propagation; free radicals react with molecules to produce new free radicals and molecules.
Termination; two free radicals combine and form covalent bonds to produce stable molecules. Note that it is possible for two carbon-containing free-radicals to combine, leading to the production of trace amounts of long carbon chains in the product.
Initiation
where the big black dot indicates unpaired electrons attached to the atom.