We present a mathematical model for calculating the electric field induced in the head during magnetic stimulation of the cortex. The electric field arises from 2 sources: (1) the changing magnetic field creates an electric field in the tissue by electromagnetic induction, and (2) a charge distribution arises on the surface of the head and produces its own electrostatic field. A 3-sphere model is used to represent the brain, skull and scalp. The electric field as a function of the coil position, shape and orientation is computed numerically. The charge distribution partially shields the brain from the stimulus. The electric field is insensitive to the skull conductivity, in contrast with electrical stimulation using surface electrodes. Different coil shapes and orientations are considered, and a figure-of-eight coil is shown to deliver the largest and most focal stimulus.