A method of preparing semiconductor layers to constitute a p-n junction used for a photoelectric transfer device, wherein each of said semiconductor layers comprises a II-VI atom chemically bonding compound in which the Group II atom is Cd and the Group VI atom is S, which comprises providing a substrate and then pyrolytically decomposing an organometallic compound having Cd-S bonding which is selected from the group consisting of mercapatide, thiosulfate, dithiosulfate, thiocarboxylate, dithiocarboxylate, thiocarbamate, and dithiocarbamate of cadmium.