Neural activity as measured non-invasively using electroencephalography (EEG) or magnetoencephalography (MEG) originates in the cortical gray matter. In the cortex, pyramidal cells are organized in columns and activated coherently, leading to current flow perpendicular to the cortical surface. In recent years, beamforming algorithms have been developed, which use this property as an anatomical constraint for the locations and directions of potential sources in MEG data analysis. Here, we extend this work to EEG recordings, which require a more sophisticated forward model due to the blurring of the electric current at tissue boundaries where the conductivity changes. Using CT scans, we create a realistic three-layer head model consisting of tessellated surfaces that represent the cerebrospinal fluid-skull, skull-scalp, and scalp-air boundaries. The cortical gray matter surface, the anatomical constraint for the source dipoles, is extracted from MRI scans. EEG beamforming is implemented on simulated sets of EEG data for three different head models: single spherical, multi-shell spherical, and multi-shell realistic. Using the same conditions for simulated EEG and MEG data, it is shown (and quantified by receiver operating characteristic analysis) that EEG beamforming detects radially oriented sources, to which MEG lacks sensitivity. By merging several techniques, such as linearly constrained minimum variance beamforming, realistic geometry forward solutions, and cortical constraints, we demonstrate it is possible to localize and estimate the dynamics of dipolar and spatially extended (distributed) sources of neural activity.