Where in Maryland are you going? See the bus listings on the bus page. Some of the DC-bound buses stop in Baltimore, check their schedules for fares and travel times. Anywhere other than the DC or Baltimore areas you will probably need to take Greyhound which leaves from Port Authority Bus Terminal. From JFK you can take the NYAS express bus from terminals PA or E subway from Jamaica (take Airtrain) to Port Auth. If you take any of the DC-bound buses from Penn Station, there's a NYAS express bus that goes there as does the E subway and LIRR from Jamaica.
Where in Maryland are you