Here are my methods.
1. Grav Turrets. These will work by slowing the enemy down, but make sure you kill the enemy before they get out of turret range. Comes with a knowledge cost.
2. Spider Turrets. This is Sniper Turret Upgrade. They work the same way, but inflict engine damage as well. Perfect for ships immune to tractor beams that like to invade your systems. The Spider Turrets will kill the engines of the Raid Starship, allowing you to deal with it in your own time. Captured Ion Cannons will do much the same thing. Whilst they won't instakill anything above their level, they still deal engine damage. There's another caputurable in the expansion that does high damage to starships as well (similar to an ion cannon), although the name escapes me at the moment. Something like a planetary mass driver I think.
3. Spiders. An advanced ship, spiders will deal engine damage to enemies. They're not as fast as Raid Starships though, so you'll need to use them in conjunction with something that will hold the Raid Starship in place, such as Grav Turrets or EMP Mines.
4. EMP Mines. They're an expansion only mine upgrade. Ships that run into EMP mines are temporarily disabled. Use that time do kill the starship, or disable the engines (such as with Spiders).
Spider Turrets are the most expensive, but can hit a ship anywhere on a planet, which makes them a decent, more general upgrade in any game and will work wonders against starships. However if you can get the job done at the wormhole, use the EMP Mines or Grav Turrets.