In today's marketplace, you should write a spec script because you have a passion for screenwriting and a story that you feel needs to be told. You shouldn't write a spec with the sole intention of selling it as you'll likely be disappointed if it doesn't (and most don't).
While I certainly don't want to discourage you from writing your spec, nor do I want you to think that selling it is impossible. But since the '07/'08 WGA strike and cut backs in development resources, the spec market (in terms of sales) is a shell of what it used to be and spec sales from baby writers is extremely rare.
You are FAR more likely to be able to gain paid writing work by using a great spec as a writing sample, either OWA's or working with an executive or producer (who like the writing in your original spec) to develop a new idea - which then can sell as a "spec" or possibly even as a "pitch".
But, if you're determined to sell a spec and that's the primary reason you're writing it, the steps would be (in an ideal world).
1) Write a spec.
2) Re-write and polish until it's GREAT. Not good. GREAT.
3) Submit to agents/managers if you don't already have one.
4) Sign with a rep (agent/manager).
5) Rep sends out your script wide to industry.
6) Interested parties will make an offer.
7) You and your rep will select the best and sell the screenplay.

Start over, back at 1.
There are obviously other steps not included here, and 3/4 is only if you're not repped, but that's the simple progression.
Again, for 99.9% of spec scripts, #6 & 7 never happens and it's back to #1 for another attempt. Most established screenwriters rarely write specs as they are so much work and such long shots to sell (in features - TV is different and spec pilots are fairly common). Most veteran writers get paid to do OWA's and rewrites. If they have an idea, they tend to pitch it and if that is bought, they get paid to write the actual script.
But for newer writers, spec's are great ways to get into the industry and attract the attention of those who can pay you to write. The only thing is, don't write it with the "intent" to sell because you will likely be disappointed as most specs never will. In addition, if you're writing with the "intent" to sell, you may be writing an idea that you think "will" sell and those tend to be derivative of whatever hot trend is going (superheroes, zombies, etc.) and are usually late to the party and/or lack passion of someone who truly has a story to tell rather than merely a story they want to sell.
If you write it as a writing sample and it does beat the odds and sell, then you can celebrate. But if it doesn't, and again - most don't, at least you have a great writing sample to help gain you other paid writing work with.
Good luck!