"Best" and "cheapest" are often mutually exclusive. If you have not yet purchased your ticket, you should inquire about the cost of adding on the JFK-PHL-JFK flights operated by Delta.
For ground transportation, the absolute cheapest way would probably involve taking the Q-10 or Q-10 Limited bus from JFK Terminal 4 to the "A" train subway at Lefferts Boulevard and Liberty Avenue. Take the "A" train to 34th Street/Penn Station, and then take Bolt Bus or Megabus from there to Philadelphia. The whole trip could cost under $10, depending on whether you are able to secure one of the very cheap seats on the bus by being among the first to book a particular trip.
Other, more expensive ground transportation options include taking the AirTrain to Jamaica Station, the subway or Long Island Rail Road from there to Penn Station, and then Amtrak or one of the aforementioned buses to Philadelphia.
"Best" and "cheapest" are