With ultrasound there is an A-Scan and a B-Scan, where B-Scans are just multiple A-Scans together.
The basic principle is to scan at a specific location and you receive a 1-D -Signal which consists of only signal peaks (reflections, which is the starting signal shifted in time and attenuated of course).
You then move your ultrasonic device a few millimeters to either side and do the same again. You can then put all of those 1-D signals side by side basically and receive a 2-D Picture (or signal).
Of course these are just the basics and im not an ultrasonic expert, so I can not tell you how specifically ultrasonic methods for medical imaging work (how they generate a 2D picture seemingly instantly).