The finite element method (FEM) is introduced to numerically model near-field diffraction devices using Maxwell's equations. This method is commonly used in the antenna and microwave communities to analyze scattering and waveguiding problems, but is not yet popular in the optics community. Its advantages are the rigorous modeling using Maxwell's equations, the ease of implementation, the sparsity of the resulting system matrix, and the possibility to include complex material structures. The FEM can be used for perlormance evaluation of given devices and as a helpful tool in the design process for new devices. The FEM is reviewed, its numerical implementation is discussed, and some example structures are considered.