There is a high fundamental interest in the surface and bulk chemistry of quantum dot (QD) solids, as they have proven to be very promising materials in optoelectronic devices. The choice of surface ligands for quantum dots in solid devices determines many of the film properties, as the ligands influence for example the doping density, chemical stability and charge transport. Lead halide ligands have developed as the main ligand of choice for lead sulfide quantum dots, as they have been shown to passivate quantum dot surfaces and enhance the chemical stability. In this study, we successfully varied the ligand composition on the surface of PbS quantum dot films from pure lead iodide to pure lead bromide and investigated its influence on the chemical and electronic structure of the QD solids using hard X-ray photoelectron spectroscopy (HAXPES). Furthermore, we developed a surface treatment to prevent the surface oxidation of a bulk PbS reference sample. Through measurements of this sample and of lead halide reference samples, we were able to assign the contributions of different chemical bonding to the Pb 4f core level and of different atomic orbitals to the valence band spectral shape of the QD materials. Overall, we found that the valence band edge position was very similar for all different iodide:bromide ratios and that all investigated compositions were able to protect the quantum dot surfaces within solid films from oxidation. However, the ligand composition significantly influences the sample stability under X-rays. The iodide rich QD solids showed the highest stability with very little to no chemical changes over several hours of X-ray exposure, while the bromide rich QD solids changed already within the first hour of exposure.