Ultrasounds done during mid to late pregnancy are usually abdominal ultrasounds. In other words, a transducer (a device that emits and receives sound waves for an ultrasound) is moved around over the abdomen.
Sound waves are emitted by the transducer. They echo (or bounce back) when they hit your internal organs. The ultrasound machine interprets these signals and turns them into a digital image.