A method of optimizing transcranial magnetic stimulation is described. An electrical signal is applied to a coil to generate one or more magnetic field pulses for transcranial magnetic stimulation of a target cortical region of a patient. The transcranial magnetic stimulation has stimulation parameters including orientation of the coil relative to the patient and intensity of the magnetic stimulation. At least the orientation of the coil relative to the patient is varied. At different orientations of the coil relative to the patient, neuron activation at the target cortical region is determined by monitoring changes in blood flow and/or blood oxygenation, e.g. using near infra-red spectroscopy. Based on information obtained during the monitoring, one or more optimal coil orientations for the transcranial magnetic stimulation are determined. Apparatus for carrying out the method is also described.