The paper proposes a modeling technique to analyze the response of a transmission line terminated by a lightning arrester connected to a grounding system buried in a lossy ground. In this technique, the transmission line is modeled in the frequency domain with the aid of Baum-Liu-Tesche equations, while the grounding system to which the arrester is connected is treated using a general electromagnetic approach. The electromagnetic approach is based on the solutions to Maxwell's equations obtained by using the method of moment in the frequency domain. The arrester nonlinearity is included in the frequency-domain analysis using the arithmetic operator method. To examine the performance of the proposed modeling technique, numerical results are presented for a single-conductor transmission line connected to a typical lightning arrester. The results are first compared for a simple grounding configuration of a vertical rod with those obtained using the well-known electromagnetic transient program, showing the validity of the proposed technique. The generality of the technique is then demonstrated by studying the results of a more complex case of a typical grounding grid. It is shown that the early time responses of the lightning overvoltages are affected by the harmonic impedance of the grounding system.