Once you reach Bay Shore, Sayville, or Patchogue via train, you can take a short taxi ride to the relevant ferry terminal. The ferry costs around $10 one-way. Ferry schedules vary according to season, so it's a good idea to check their official sites for the most up-to-date information.