The light-dependent reactions
In the thylakoid membranes, light excites electrons from chlorophyll, water is split to replace them, and the electrons' path pumps protons whose flow back through ATP synthase makes ATP, with NADPH made at the end.
From AP Biology.