Ranged Attacks
When making a ranged attack, you use a ranged weapon to shoot at an opponent from a distance. If you’re attacking with a thrown weapon, your ranged attack bonus equals your base attack bonus (determined by your class and level; see Chapter 4) + your Strength modifier. Otherwise, your attack bonus for a ranged attack equals your base attack bonus + your Dexterity modifier.
When you make a ranged attack, you might also take a penalty for shooting or throwing your weapon beyond the distance listed as its optimal range (see Range and Penalties on page 245).
Source
Core Rulebook pg. 240