You can get detailed information about the Long Island Rail Road (schedules, fares, and a system map) at:
http://www.mta.info
From any JFK terminal, you can ride the AirTrain to Jamaica Station, which is a hub for the Long Island Rail Road. The fare for the AirTrain ride is $5.00, payable upon arrival at Jamaica Station.
You can get detailed