Against Fox, if you can, DI their shines to mess up their shine combos. Obviously, don't get grabbed because uthrow-uair ***** Marth like no other. Don't listen to people who call chaingrabbing cheap. It is the only way Marth can win against good space animals.
If all else fails, switch characters. (I use Samus)
Switch characters? Marth is one of the only characters that does well against Fox, besides other space animals. Falco matchups are significantly harder IMO because the l8zorz **** up your rhythm.
Other than what's already been said I can't add much, except for some more specifics on edgeguarding.
If the Fox/Falco is using Foxfire (or whatever the hell it's called) to come near the edge, whether trying to sweet spot it or land on the stage, just stand over the edge and counter. Then drop down with a neutral B or FAIR to hit them out of their second FoxFire, then edgehog. You could also just stand there near the edge charging a neutral B, but I don't think this is as advantageous for a couple reasons. For one, it limits your choices if the Fox/Falco decides to go over your head. If you're waiting to counter and they go over your head, you can jump up and hit them with a well-placed BAIR. Also, counter to FAIR/neutral B seems more devestating against spacies at lower % than neutral B from the stage.
In general you can leap off the stage with reckless abandon and hit spacies out of their Firefox with a neutral B. If you're edgehogging, don't be afraid to do ledge-hopped BAIRs. Just practice this stuff so you won't SD in a real match. =p
Always be aware of whether you still have your floaty forward B. You only get one per jump, and it doesn't come back when you grab a ledge. I've died many times doing overly fancy ledge-hopped attacks from which I can't recover because I lost my float forward B.