Scout 3/Ranger 14/Pious Templar 3
A simple build, no cheese at all.
Take the feats Improved Skirmish, Swift Hunter & Greater Manyshot as essential to the concept. Ranged Weapon Mastery is recommended.
At high levels, you can move your base landspeed of 40 ft. and fire four arrows with Greater Manyshot. That's an extra 28d6 skirmishing damage. Your AC will be at +6 in every round you moved at least 20ft.
You take undead, outsider (neutral), plant creatures & constructs as Favored Enemy, you can now do skirmishing damage to nigh every creature in the game.
Unlike some others have said, mobility is very crucial for archers in my games, since you don't want to get stuck in melee combat. A DM that lacks ideas and handles his evil guys as dumb morons might do you the favor to grant you full attacks and not take you into melee, but an inventive and clever DM will try to make things challenging for you. Thus, movement + attack is a fine option for archers.
Should you feel like melee can't be avoided, cast Lion's Charge and get up to 49d6 bonus skirmishing damage on your charge. (With the Two-Weapon Fighting tree)
If possible, try to sneak the "Splitting" enhancement into your game (It's Forgotten Realms).
With a splitting bow, you can make use of your move action every round and fire eight arrows for up to 56d6 skirmishing bonus damage - with hardly any creature immune to it.
Assuming a +4 splitting frost longbow, a Str 18 and Ranged Weapon Mastery (easy at high levels), that's up to: 8d8 (bow) +8d6 (cold) +32 (str) + 32 (magic) + 32 (mastery) + 56d6 (skirmish) = or an average of 352 points of damage, critical hits or FAvored Enemy damage bonuses not yet included.
As a matter of fact, you will pump all your stat increases & free resources into Dex - your damage output is well taken care of, you just have to hit as good as possible
Apart from that, you have BAB +19, 4th level ranger spells, nigh all the other ranger goodies, fast movement, uncanny dodge, smite 1/day, DR 1/-, Mettle, Evasion, and whatnot plus many skilll points. Your saves will be base 14/13/8, not too shabby as well. Just the package for an archer.