There are two main ways this was solved:
1. Measuring Focus
When using this method, the focus puller measures the distances at every point during the shot, and then pulls focus to these marks, at times making adjustments when an actor or grip misses their mark.
This still occurs today, however is becoming less prevalent due to the filmmaking styles being used (handheld, where the same marks are not hit each time).
2. Video Assist
Using one of several methods, including half-silvered mirrors, CCD sensors behind the film negative, and telecine transfers, a video split is made. On modern productions shooting on film, this split is what is sent to 'Video Village', where the director sits.
Telecine Transfer (Not the correct term)
I've never really understood how it worked, until now, so I present this lovely diagram from Wikipedia:
In essence, the light shines in and exposes the negative. After that, it passes through a series of half-silvered mirrors, each time being split into separate light components and recorded onto an imaging chip. These are them combined, and displayed in the viewfinder, or as a video-out.
One side effect of this method, is the mechanical shutter is visible, as a black screen lasting 1/50th of a second, 25 times a second (whenever the negative itself is not exposed).
3. Parallel Sight
Common throughout the 1950s and 60s, having a parallel sight (separate lens, like what you had on a cheap film point-and-shoot camera) allowed the operator to see approximately what was being exposed onto the negative.
4. Half-Silvered Mirror
Update: Added from AJ Henderson's comment below.
As mentioned in the comment, a very cheap way of getting an image to a viewfinder was to simply use a half-silvered mirror, somewhere between the lens and the negative. In this way, half the light transmitted through the lens exposes the negative, and half is seen through the operator's viewfinder.
This method does not allow for multiple viewfinders, monitors, or screens, unless another split is created.