Pathfinder Adventure Path Charter Subscriber; Roleplaying Game Subscriber
Deadly Aim is like Power Attack for ranged weapons. The Vital Strike feat chain can increase damage more than Focused Shot; Devastating Strike adds even more. Hammer the Gap adds to damage against one foe when making a full attack.
The spell gravity bow (which rangers have on their spell list) increases a crossbow's base damage.
Talk to you GM about using a heavy crossbow one size category larger ("you can shoot, but not load, a heavy crossbow with one hand"); if the GM allows it, find out if the penalty is -2 as normal for an inappropriately sized weapon or -6 (including the -4 penalty for firing "one handed"). Alternately, a double crossbow can provide similar effectiveness.
I would go Ranger for the first 6 levels to cherry pick Improved Precise Shot, and then jump into Fighter (weapon master or regular fighter, NOT the crossbowman archetype) for damage bonuses (Weapon Specialization, Weapon Training, gloves of dueling) and Point Blank Master.
Straight classed Ranger can work out long-term if you can afford a lot of 3rd level pearls of power so as to hit every major foe you face with the Instant Enemy spell, to get your highest favored enemy bonus against them; otherwise, Ranger will not be able to give you the damage boost you need. Freebooter Ranger archetype might possibly work, in that it's lower damage than favored enemy bonus or just being a fighter, but you get to buff the entire party like a bard (and it would stack w/ inspire courage) in return.
Point Blank Shot
Precise Shot
Rapid Reload
Rapid Shot [assuming it works]
Deadly Aim
Focused Shot [if Int is at least +2]
Exotic Weapon Pro Repeating Crossbow [if extra shots not available via rapid/many]
Rapid Reload and Deadly could be free feats from combat style that still leaves 5 more feats to take as soon as possible.
If a Human you can take 2 at level 1, then take one at level 3 and one at level 5.
It's really interesting and fun to try and make it work, and I it's cool, but yeah, it's really just sub-optimal.
The best thing I could recommend beyond what has already been said is to try and get the Kirin Style chain, so you can add your Int to damage again. It won't ever outdo a bow user, but it could be fun and have some niche uses.
I played a crossbow user once. I was an Inquisitor. Between Bane, Judgments, and having a +1 flaming crossbow, I never had a problem dealing enough damage. With a Ranger, you might not have as easy a time with it because all you have to add to damage is Favored Enemy and you won't get to add it all the time.
As for feats, it's really only one feat more (Rapid Reload) than any other archer. Rapid Shot does indeed work, as long as you can reload fast enough (which means it won't with a heavy crossbow, sadly). If you go Vital Strike, you definitely want Gravity Bow.
I'd agree that a Fighter would probably work better-- he just has more ways of adding static damage to his attacks, and he wins out on bonus feats as well. Get Deadly Aim and Rapid Reload ASAP, Weapon Spec as soon as you meet the prereq, and the others where you can.
And of course, make sure your crossbow is as magic as you can afford. If you can't cast Gravity Bow, the Impact weapon property will help (and work great with Vital Strike). Flaming, Shocking, and the like are always nice, as is Merciful if you think you might want to take prisoners (or just don't want to have to worry about elemental resistance).
Is it worth getting Keen on a 19-20/x2 weapon? Keen and Impact work nicely together.
I played a crossbow user once. I was an Inquisitor. Between Bane, Judgments, and having a +1 flaming crossbow, I never had a problem dealing enough damage. With a Ranger, you might not have as easy a time with it because all you have to add to damage is Favored Enemy and you won't get to add it all the time.
I was intrigued by the fact that inquisitors specifically get proficiency with repeating crossbows, so made one up as an evil NPC. At 8th level, with that 2nd iterative attack, Rapid Shot to bump up to 3 shots/round, Deadly Aim, and using judgement and bane to balance the attack penalties you can make quite the artillery: 3 attacks @ 1d10+2d6+4 in the first round and 2 attacks in the second before needing to reload. Maybe not the best all-round build for a PC, but can drive players bonkers if built as an enemy, especially if terrain / etc. keeps them out of reach.
(Note that you have to activate the judgement and bane as separate swift actions, so this works best in an ambush situation where the inquisitor can pop judgement from hiding / in surprise round, and then activate bane during their first full round.)
I do remember that character being fairly starved for swift actions, but an Inquisitor's Wisdom and Initiative bonuses mean that as long as you don't roll 1's on your Perception/Initiative checks, you should have Bane and Judgment up before the end of the first round even if you're the one being ambushed.
The Crossbow Mastery feat in the APC lets you reload a heavy crossbow as a free action.
It is pretty suboptimal, but it is kind of cool. I remember back in second edition days, when a heavy crossbow just took a full round to load and there was no getting around that, one of my player's solution to that was just to always load it as soon as anything happened, so it was loaded and ready to go before combat started.
DM: Ok, as you're walking through the woods, you come into a green, grassy clearing with a stream running through it...