Like a lot of characters that tend to either zone you out with projectiles or wreck you in close quarters, Doc is one that does have key flaws that Marth can easily exploit. First, Doc can be juggled easily with a string of u-tilts for easy damage. Due to his air speed, Ken combos are easier on Doc, and edge guarding in general is easier in the matchup (watch out for the f*cking cape though). If he starts spamming pills, be patient and just wait for him to go in. If Doc is intent on keeping the spam up, try and time your approach to the moment in time when Doc is in between his pills and try for classic approaches like d-tilt, f-air, and n-air.
Hope this helps! GLHF!