Before computed tomographic (CT) scans became available in 1970s, there was no good method for imaging brain. The available methods and technologies struck around target without quite hitting bull's-eye.
We had skull x-rays which imaged bony brain-case, but not brain itself. We had arteriograms which imaged insides of blood-vessels supplying brain. We had nuclear brain scans which imaged chunks of brain that were recently damaged. We had a particularly nasty test called a pneumoencephalogram (PEG) in which doctor squirted air through a spinal tap needle and encouraged it to bubble around and inside brain by turning patient every which-a-way—including upside-down—while x-ray pictures showed where air could and couldn't go. Finally, most accurate method was not a physical picture at all, but a mind's-eye picture within brain of an examining neurologist. Yet diagnoses still got made and patients did get treated.
CT scans revolutionized practice of neurology. It's not that other methods disappeared (well, yes, PEGs thankfully did disappear) but that CT scans vastly improved accuracy of diagnosis and treatment. Even when CT scans didn't show disease itself (e.g. multiple sclerosis or a fresh stroke) they assisted diagnostic process by proving absence of a brain tumor, abscess or hemorrhage that were also on list of diagnostic possibilities.
CT scans did (and still do) this by sending x-ray beams through head at various angles and collecting x-ray beams on opposite side that were not absorbed by head. Then magic occurs. A series of images appear on a computer monitor or on x-ray film as if head had been run through a giant salami-cutter and slices were laid out flat and in sequence.
On CT pictures different parts of head are displayed in various shades of gray according to how much they absorb x-rays. The skull-bone absorbs x-rays most and shows as whitest component. At other end of gray-scale, watery spaces in and around brain absorb x-rays least and show as blackest components. The brain itself is somewhere in between, showing up in mid-gray range. Abnormal components, like brain tumors and blood-collections, are identified not just by appearing in their own shades of gray, but also by their locations and shapes. Creating a second set of slices after patient receives an infusion of intravenous dye provides an additional dimension to imaging not unlike that provided by older, nuclear scans.
Then in 1980s magnetic resonance imaging (MRI) scans burst upon scene and astonished medical community by not just imaging brain itself, but by doing so in a brand-new way. Instead of imaging extent to which head's different components absorb x-rays, MRIs instead focus on water-molecules. To be more precise, MRIs image rate at which spinning hydrogen-atoms of water molecules within different parts of brain either line-up or fall out or alignment with a strong magnetic field. These differing rates of magnetization or de-magnetization are fed into a computer. Then magic occurs yet again. A series of slice-like images is created and displayed on a computer-screen or x-ray-type film in shades of gray. Abnormal structures, like brain-tumors or plaques of multiple sclerosis, are displayed in their own shades of gray and are also recognizable by their shapes and locations. Obtaining another set of images after intravenous administration of gadolinium—the MRI equivalent of x-ray dye—also adds diagnostic information.