I'm reading a book on pirates of the late 1600s and early 1700s, and it goes into some detail about the living conditions of crewmen aboard British Navy ships.
Day-to-day living condition problems like rotten food, corrupted water stores, and general lack of hygiene which lead to sickness are reoccurring subjects. As are things such as injuries on the job, from punishment, or during naval combat.
The book mention's ships' doctors in passing but doesn't really talk about what they may have done for crews. The turnover rate of the time period obviously suggests the were not what we would consider highly effective, but it seems that when pirates captured ships or crews mutinied, capturing a doctor was seen as important, so they must have had some value.
Well, a "doctor" in the sense of a physician would have been unlikely to be on an individual ship that was any smaller than a flagship (the Aubrey-Maturin series of novels aside). What would likely be on a RN ship of that period would be a surgeon and one or more of his mates, depending on the size of the ship. The RN actually reinstated the Sick and Wounded Commission in 1664, right before the time period you're asking about, to work with the fleet's Surgeon General and hospital ships (the commission's charge was sick and prisoners on land). The Surgeon General supervised the fleet's surgeons, many of whom started their surgical careers in the navy before setting up practices ashore.
The surgeon could perform basic surgeries and first aid (think amputations, appendectomies, lithotomies), do basic nursing jobs, and also give advice for passing or condemning water, beer/liquor and victuals that could affect men's health. Surgeons also dealt with what we'd now consider occupational hazards, such as sprains and breaks from falls, hernias, and the like. They had a fairly limited set of tools to work with with regard to medications, but knew basics such as isolating people who were sick, using reduced or altered rations, etc.
Interestingly, in the RN the cost of medications for dosing the sick was taken out of the men's pay. But sailors hurt on the job also had access to funds from the "Chatham chest," set up in the 1590s to offer pensions to injured seamen -- it paid out bounties for the loss of limbs, eyes, etc., as well as the pension funding.
It would take a book to fully answer your question, although jschooltiger has given an excellent summary of the ship's surgeon's role during this time which I doubt I could add much to.
If you're interested in how the surgeries were performed during the Golden Age of Piracy (late 17th - early 18th century - the same period you mention), what the tools looked like and how they were used, medicines, bits and pieces on day-to-day life such as where the surgeon operated (the orlop deck), his role as barber and the history of surgeons captured by pirates, check out my web page. It's focused on pirate surgeons, but the material is equally applicable to naval surgeons. (In fact, many of the period books for sea surgeons were written by naval surgeons such as John Moyle and John Atkins.)