Simple analytical solutions for the prices of discretely monitored barrier options do not yet exist in the literature. This paper presents a semi-analytical and fully explicit solution for pricing discretely monitored barrier options when the underlying asset is driven by a general Lévy process. The explicit formula only involves elementary functions, and the Greeks are also explicitly available with little additional computation. By performing a Z-transform, we reduce the valuation problem to an integral equation. This equation is solved analytically with the solution expressed in terms of a Fourier cosine series. We then manage to analytically carry out the Z-transform inversion, and obtain a semi-analytical formula for pricing discrete barrier options. We establish the theoretical error bound and analyze the convergence order of our method. Numerical implementation demonstrates that our numerical results are accurate and efficient, and match up with the results from the benchmark methods in the literature.