Well there are multiple technologies doctors use. You're probably familiar with the fMRI (fundamental magnetic resonance imaging) technique that measures brain activity.
The fMRI works by detecting changes in blood oxygenation, since when the brain is more active more oxygen is used.
---
Another one you might be familiar with: a CT scan (computed tomography).
It's like an xray for your brain. You sit in this hallow cylindrical apparatus, then you get all sorts of xray beams to your head. The imagery you get depends on the absorption of the beam through the tissue that passes.
---
Then there's EEG, or simply put, Electroencephalography. You know in TV shows where scientists put those weird white sticker things on people's heads? Its that. The white sticker things are called electrodes and are only placed on the scalp, and it measures electrical activity. Its non-invasive, so it's frequently used for experiments.
I hope these helped somewhat