Agree with Nancy. If you get a morning start (before 9am) you could be in Sorrento by 1pm. I don't think schedules are available that far out, but currently there is a 8:08am train from Florence.
Sorrento is beautiful! RS guide hits it right on, try having dinner at one of the places on the little harbor. And you can take the bus down to Positano and/or Amalfi for a day.
Note, though, that in Sorrento at least the notion of "beach" is a misnomer. The coast is very steep, instead down at the harbor they have floating docks where you can rent lounge chairs and an umbrella. We did that, it was fun. Positano and Amalfi have actual sand beaches, and there are some near Sorrento too.