There are good, well-stocked pharmacies in St. Thomas [1], St. Croix, and in Road Town, Tortola [2], but to avoid hassle, bring any prescription medicine you need (in its original container) with you to the islands. It is also a good idea to bring the prescriptions themselves in case you need a refill.
Links:
[1] http://www.moon.com/destinations/virgin-islands/st-thomas
[2] http://www.moon.com/destinations/virgin-islands/tortola/sights/road-town