Firing Vehicle Weapons
Firing a weapon mounted on a vehicle works like firing a normal ranged weapon, but you must activate the vehicle’s weapons instead of ones you hold. The penalties to attack rolls in the vehicle’s Modifiers entry also apply to attacks made with a vehicle’s weapons.
Some vehicles have weapons bound to their steering devices or weapons that are operated from the same control panel. These can be fired when you are piloting, though you normally can’t fire the vehicle’s weapons on the same turn that you race (or on the same turn that you take another full action) because you don’t have enough available actions. Weapons mounted in other manners typically need to be fired by creatures on the vehicle that are dedicated gunners.
Source
Core Rulebook pg. 281