So why does the Raycast line get crooked when the ship the gun is fired from is moving?
To the best of my understanding, it has to do with relative velocities and how they're kind of ignored with raycast weapons. While a raycast weapon travels near instantaneously, it's treated as though it has a finite muzzle velocity, and follows the path it would take if it actually travelled with that finite velocity. It just travels along that path near instantaneously.
So let's say your raycast gun has a muzzle velocity of 200m/s. If you're moving up at a rate of 5m/s and your target is 600m away, you will need to aim 15m below where your target actually is in order to hit it (EDIT: Because it would take 3 secs for the weapon to travel 600m with a muzzle velocity of 200m/s, so 5m/s * 3s = 15m). The thing is, your opponent's velocity doesn't matter for the gatling. You could both be moving up at 5m/s such that your relative velocities are 0m/s, but you'll still have to aim 15m below it to hit. It's fairly counterintuitive, and kind of ignores physics in that regard.
The devs made sure that all the guns inherit the velocity of their ship properly. Unfortunately, that doesn't work too well for raycast weapons. Oops.
NOTE: I could be wrong about some aspects, it's been a while since I've actually fired a gatling. I did jump into the sandbox real quick to test my theory, though, and I think it checks out.