Theoretically, the Red Sox would need to beat the best offer.
If another club has the current best offer, the Red Sox theoretically would need to top that offer (or drop out).
If the Red Sox have the current best offer, J.D. Martinez and Scott Boras might be looking for a team to top that offer.
It should work out in the end.