This is definitely the best and cheapest, LIRR fare is $14.25 off-peak plus $5 Airtrain fare. It will only take you 15 minutes to get from your terminal to Jamaica Station on the Airtrain and a few minutes to purchase your ticket so you're ok even if you get to the station 15-20 minutes before departure. You can purchase your Airtrain and LIRR fares on the same ticket at Jamaica Station on the self-service machines. Just follow the instrutions on the machine, it's pretty easy, and there are nice folks there to help you.
This is definitely the best