Basically, the key difference is between the Genesis version and both Master System and Game Gear. The Genesis version is the one everyone knows with all the loops and speed sections and tubes and ramps and things. That one really shows that the Genesis was a capable machine. Many of the levels in the MS and GG versions were more like the Marble Zone levels in the Genesis game. Not many speed sections. It's much more of a Super Mario Brothers ripoff than the Genesis game was. I believe the Genesis Sonic was the first one to market. Here in the US, Master System Sonic was the last officially released MS game. In other regions where the MS saw more popularity, other Sonic games got ports to the machine like Sonic 2. We saw those games here as well on the Game Gear, though they were slightly altered for handheld play.
The Master System and Game Gear versions of Sonic 1 were near identical. Which one you prefer is a matter of preference. The Master System version looks a little nicer and has much less screen crunch, but the Game Gear version offers more opportunities for continues and is generally a bit more forgiving if I remember correctly. Not to say it's an easy game; it's not. It is really quite difficult if you ask me, but it's a blast to play.