Normally, scenes which feature actors in a moving car are shot using a process trailer. The advantage of using a process trailer is that since the car containing the actors is being towed around the city, the shots look, well, real.
Sometimes, though, process trailers are impractical – either the show can’t afford them, the show isn’t shot in the city in which it takes place or there simply isn’t enough work in the car scene to justify the hassle (get trailer, rig trailer with lights, drive around, de-rig trailer. It eats the better part of a day, and requires extra equipment and manpower, so it’s not worth it for one short scene), so then we do what’s called a poor man’s process.
Poor man’s process is when the car sits stationary on a stage and we use lighting to create the illusion that it’s moving. In this photo, we’re using a projection screen behind the car which really helps to sell it on film, but many people skip this step. There are lights placed around the car, and each light’s got a crew member (usually a grip, but since this process is labor intensive, the electricians help out, too) with it waving a solid flag in front of it periodically in order to mimic the shadows that fall across a car as it moves through traffic.
When done properly, it’s damn near impossible for the viewer to tell the difference.
Here’s a really excellent video showing (and doing a better job of explaining) a poor man’s process.