A new method to compute electromagnetic effects in hadronic processes using lattice simulations will be discussed. The presence of infrared divergences in intermediate stages of the calculation makes the procedure more complicated than in the case of the hadron spectrum. As a consequence, diagrams with virtual photons must be combined with those corresponding to the emission of real photons in order to obtain the physical result. The calculation of finite volume corrections and preliminary numerical results will also be presented.