Spectroscopic studies of the charge-transfer state and device performance of hybrid and organic solar cells