The paper addresses the important issue of evaluating the overvoltages produced on a power system by a lightning event. First, the theoretical formulation of the problem in the time domain is presented. Then its numerical solution together with its implementation is described. Finally, a PSCAD-EMTDC interface and platform is developed, which allows us to model a realistic network, automatically distinguish between direct and indirect strokes and account for power network precontingency conditions. The obtained results are compared with a frequency-domain solution for a simple case in order to validate the finite-difference time-domain method adopted to solve the coupling equations and the interface with PSCAD. The comparison with the well-known LIOV code for a more complex case is used as a general validation of the overall tool. In a companion paper, the developed platform will be used to evaluate the lightning performance of a portion of the Italian MV distribution network.