If you still need help with Sonic because there's little info, I suppose I could help. I don't have any actual expierence though.
Your projectiles will be one of the most useless things they have been in any matchup (however still not completely useless). You should shoot no more than a SH Missle + grounded missle and then use Z-air to keep Sonic away. Don't attempt to do more than one double missle, cause Sonic runs over FD in less than a second (lol I love bringing that up). Beam Shot will be hard to load, mainly because even when we are knocked away and you load, we (at least I would) ASC (Aerial Spin Charge, down-B in the air) and continue into a roll into you which gives you minimal amount of loading time. Small shots can be useful. Projectiles work offstage well too.
Z-air should be used to keep Sonic at midrange, you do not want him to get any closer than a tipper Z-air. Space this, I'm sure you can. Once Sonic gets in he has the upper hand because of punishment and fakeouts (think of Side-B shield cancel, Vertical Spindash Jump, Spinshot over you). Your Jab should be used to get him out of close combat (I'm not sure if you can shield the 2nd hit, I've been told jab has very short hitstun, but I don't know much about the hitstun on that) or any other move that is quick. Space your close moves as Sonic doesn't have many quick and ranged moves except for U-tilt, D-tilt and F-smash, which all take over at least 11 frames to get out (IIRC) and are not what he wants to use if he wants to stay in your face (well, maybe D-tilt). His Tilts are mediocre, but his smashes are pretty sweet. Hyphen Smash is cool, it goes far, F-smash is the main killer, has decent priority, good range and is a fairly quick smash. D-smash lasts long and spotdodges get hit by the small last hit (unless timed/spaced properly).
Aerially, both beat each other at certain points. I thought Samus was above midweight, but really floaty and hard to juggle. Still, Sonics U-air is really disjointed and good. Your B-air is faster than ours and probably outranges it. Sonics F-air is his fastest aerial and is autocanceled from a SH. Your U-air probably beats out our D-air. N-air is a sex kick, which Sonic isn't good against. You should not bother about Sonics N-air. Watch out for B-air kills.
Sonic can kill off the top with a Spring U-air, might you be high in the air, about the top of the screen. Watch out. Sonic is a character that depends on punishing, but your aerials have little to no lag. Good for you
Sonics recovery is one of the most versatile and unpredictable recoveries there is. If you are doing it right, you shouldn't need Spring, but it's a fun move
. While Sonic is springing you should be using U-tilt (we can still airdodge, attack and footstool out of it). You can also grab Sonic out of his Spring, like you can with Snake and lol while he dies. D-air spiking isn't as easy as it sounds because we can airdodge before we're even halfway up and we have invincibility frames when we spring (for the first half). Edgehogging for a long time is useless, as Sonic can jump off your head when you have no infzy frames on the edge. If you come across a stupid Sonic using Homing Attack (neutral B) to try to recover (ESPECIALLY WHEN BELOW THE STAGE), use a spotdodge as he falls to his doom. Spinshot is a terrible option as well. Hit him out of it and watch how he is forced to Spring or use HA because he wasted it's second jump.
Sonics recovery is very so superior to you. This does not mean a good Samus gets gimped often. Your tether recovery is good, but a (h)edgehog takes care of that. This forces an up-B. Now this will be used so that it hits Sonic, or at least make him go off the edge so you can grab the edge. Sonic is pretty good in edgeguarding, with his D-air, Spring, F-air and B-air. D-air is great because the sweetspot semi spikes and we still make it back. Just try to stay on stage and avoid any contact with ledge.
Killing for you should be done by B-air and F-smash near the ledge. Sonic has a sort of bucket cancel, but a bit slower (his side/down-B). You should watch out for the 3 killing moves, F-smash, D-smash and B-air. Don't use your shield sparingly, Sonic hasn't got much shield degrading moves.
Sonics grab game is amazingly superior to you. He has more chances to grab, more damage, less punishable, and better followups. If you get grabbed, don't expect just 12% from the U-throw, but expect to be hit by something else after it. But that's more a mindgame and isn't that relevant to the matchup. D-throw can be teched immedeatly in front of Sonic, but your only option is to jab or he can shield. Sonic's U-throw kills at 200% or so and sets up for juggles, but you're light so shouldn't be hit by more than one U-air. I can't really go into detail about your grabs, because you might pull one or two off, and I don't know any followups or what you can do either <_<
Long write-up is long... I don't have any Samus expierence, but I do/did play her sometimes. Samus should keep Sonic away as much as possible. Don't let him get into close range. In the air Sonic and Samus are equally matched IMO. Offstage Sonic has the upper hand. Close range Sonic has the upper hand, because that's his only option because of his moveset. Far away, Samus has the obvious upper hand. Use Z-air, tilts, jabs, and moves with as less lag as possible.
I'd give this ratio 55:45 Samus, but Sonic has many mindgames that can't be accounted here, but do count in the game. It's one of the most even matches if you play it.
Also, any "I can do X to Sonics roll attack" should be disregarded because Sonics don't approach with that.