"One must not put a loaded rifle on the stage if no one is thinking of firing it."
-- Anton Chekhov
This is good advice. By putting a loaded gun on stage (or on the mantle, in the other version of this quote), you are making a promise to the reader. If that gun doesn't go off, it's not only wasting words but it's kind of a let down. If a storm is brewing, it better hit by the end. If there are embarrassing secrets, their keepers must be embarrassed!
But there's a problem: if the gun always goes off, then as soon as it's introduced, the reader knows what will happen.
I noticed this while reading Duma Key by Stephen King. There's some early foreshadowing that basically told me how it would end and drained some of the tension. I respect Stephen King, so I won't spoil his novel by using it as an example. Instead, I'll spoil Avatar.
Jake's girlfriend tells him the Turok is the biggest predator on the planet. "It has only been tamed five times in our history," she says. "Those riders became legends. They brought all the tribes together, bringing peace to the world."
Gun. Mantle. You don't have to see the movie to know what they do with it. Foreshadowing is good, and Chekhov was right about using all the elements you put on stage. But if you're not careful, it becomes obvious and predictable.*
The trick? One trick is to be subtle. Subtle foreshadowing is the stuff you don't realize was there until after the gun goes off, then you're all, "Holy crap, it was there the whole time!"
Another trick is to foreshadow things so that the reader has to know how it happens. The Turok wasn't interesting because we knew the result: Jake would prove himself legend, bring the tribes together, and use their combined might to fight the humans. Contrast that with the other Avatar: the final showdown between Aang and Ozai is forecasted from episode 1, but you have to see it because (a) Ozai has to be killed and (b) Aang doesn't kill anybody.
If you must foreshadow plainly, then twist what the reader expects. The gun goes off, but it backfires on the shooter. Jake fails to bond with the Turok, but his girlfriend rescues him and she becomes the legendary rider.**
Like anything in writing, be intentional. Keep your promises to the reader, but don't stick to the letter of the promise. A predictable climax can be just as bad as a gun that doesn't go off.
* My only real complaint with Avatar was its predictability -- there was a lot more than just the Turok.
** Then the movie might not have been so much like this 20-second summary.