Disclaimer
This is in 3.5 btw, also I'm not saying Sonic is OP, just a ****ing pain in the *** to fight.
It's probably because you're too slow.
jk. You don't really need a secondary, but if you really want it, Sonic really hates spacies (except wolf). Hitting him horizantally is good, and make sure that you ledge hog if he uses forward b to grab the ledge. If you are really good at timing, you may be able to hit him square in the face if he blindly charges straight at you, but good sonic players don't do that so often. Also, dodging in a way that makes sure his homing attack doesn't lock on to you or hit you is quite annoying, but, well, this isn't brawl, and you don't always have that chance, and when you do, it can be punished on the way down.
Hope that helps!