The first of two major stages in photosynthesis (preceding the Calvin cycle). These reactions, which occur on the thylakoid membranes of the chloroplast or on membranes of certain prokaryotes, convert solar energy to the chemical energy of ATP and NADPH, releasing oxygen in the process.