starter going out ?

Sometimes when I turn the key to start, it spins, and try again it will turn over and start. First time it happened, I had been riding in wet weather and thought it may have got wet. It started ok, but would spin every so often then catch. The next time it happened it was dry, spin once then start. It would seem it only does it when riding. Starts every time when cold. So, do I buy a starter w/sol. or just sol., or just starter? Any thing wrong with buying after market (like fm amazon).