You pay after you get off AirTrain, which is where I'm at here, at Jamaica Station. $5.00 for the trip. Well worth the price. The same MetroCard, purchased at the vending machines against the wall, also lets a person onto the subways.
(Click the image to view a smaller version.)