TECHNOLOGY FOCUS - INORGANIC CHEMISTRY - Preferred Components: The ratio of the relative amounts x(d), y1(d) exceeds an intrinsic ratio value at the depth adjacent the first electrical contact, the intrinsic ratio value defining relative amounts xi and yi at which the CucA'x(d)B'y1(d)Z's quaternary chalcogenide compound has intrinsic conductivity type, where the ratio of the relative amounts x(d), y1(d) is below the intrinsic ratio value at the depth adjacent the second electrical contact, a sum of the ratios is constant as a function of depth. The CucA'x(d)B'y1(d)Z's quaternary chalcogenide compounds are Cu2A'x(d)B'y1(d)Z4 quaternary chalcogenide compounds. The relative amounts x(d), y1(d) vary as function of depth so that a photoactive sub-layer of intrinsic conductivity type is present in the layer in a range of depth between depths where the layer has p-type conductivity and depths where the layer has n-type conductivity. The photoactive sub-layer (PV) has a depth of at least half a micron. The relative amounts x(d), y1(d) vary as function of depth so that p-n homojunction is present in the layer. Preferred Cell: The thin-film solar cell further comprises a photoactive sub-layer of p-type conductivity or n-type conductivity and a thickness of at least half a micron, where the relative amounts x(d), y1(d) in the photoactive sub-layer have values at which the material of the photoactive sub-layer has a bandgap energy of 1.2-1.8 eV; and comprises a substrate (CR) and a buffer layer between the sub-layers with different type of conductivity in the chalcogenide layer. Preferred Method: The method further involves providing relative amounts x(d), y1(d) in a part of the chalcogenide layer with a combination of values of the relative amounts x(d), y1(d) that results in intrinsic conductivity, between the deposition with the first and second combination of values at least during deposition of half a micron of the depth of the chalcogenide layer, where the combination of values of the relative amounts x(d), y1(d) that results in the conductivity type of a photoactive sub-layer is maintained at least during deposition of half a micron of the depth of the chalcogenide layer. The deposition of the chalcogenide layer is performed under non-vacuum conditions by using spraying at atmospheric pressure. Preferred Definitions:    A'and B'=Zn or Sn.    EXAMPLE - No suitable example given.