Aim the fireball right at the target
For practical purposes, a fireball spell's "glowing pea-sized bead [that] that streaks from the [caster's] pointing digit" hits the point of origin the caster desires as soon as the spell comes into effect. While a GM may rule that it's possible for a creature to, for example, take the ready action and pick a trigger that enables the creature to interfere with the streaking bead, as long as there's a clear line of effect from the fireball spell's caster to the point of origin of the fireball spell, once the fireball spell's cast, the fireball spell effect typically occurs at that point of origin immediately.
Pathfinder largely abstracts the simultaneous nature of actual combat into turns for convenience. Chances are the distant target moved when it was able to on its turn then the caster cast the fireball spell on her turn. That doesn't mean, though, that were viewers to see the scene in a movie or on television that the distant target would conveniently stop so that the heroic wizard could take the shot that distant target! Everything'd be moving, and it's only Pathfinder's turn structure makes it seem like at the table when it's the active player's turn that the universe is mostly at rest.
Note that some games do strive for greater verisimilitude than this—some editions of both GURPS from Steve Jackson Games and Champions from Hero Games, for example— penalize attackers for firing at targets that are traveling at high speeds. Pathfinder typically doesn't.
In short, don't worry about how fast the target was going before you shot at it—just point and shoot.