Silver halides especially Silver chloride and Silver bromide undergo decomposition in presence of sunlight to produce silver metal and a halogen gas (chlorine or bromine gas).
The reactions are as follows:
2AgCl(s)sunlight⟶2Ag(s)+Cl2(g)↑
2AgBr(s)sunlight⟶2Ag(s)+Br2(g)↑