Use search, its here somewhere, but basicaly its:
+ SKILL
+ (PE-2)x8 alebo 16 (if weapon has long range perk)
+ 0 or 20 (if weapon has accurate perk)
- 4x distance in hexes
- AC of enemy
- n x 20 (n for missing strength)
As you can see, for every point missing in strength, you have - 20% to hit. There are no limitations in this formula, you can supplement missing strength with higher skill. You can have 95% to hit with any weapon, you just need to calculate it with this formula. Skill required varies for each weapon used.
Example: I have laser rifle ( 6 STR required ), my char has 5 STR and 8 PE and I want to know how many points I need to spend in energy weapons in order to have 95% to hit while shooting a guy with 30 AC at max range ( 45y )
So X(Skill)+6*16((PE-2)*Long range weapon) -30(AC)-4*45(Max Distance)-60(Eye shot penalty)-20(1 STR missing)=95%
X = 289 Skill - thats quite a lot
But imagine having 6 STR and 10 PE -> thats 289 - 20 - 32 = 237 Skill
So conclusion, having STR requirements met and high perception helps a lot when fighting at long range