A lot of time the problem is simple. Like a gas cap that is leaking. A quick trip to an auto parts store and a Free Retest will have you back on your way.
Other more serious problems may be covered under what some people consider secret warranties. If your car is less than 8 years old and has less than 80,000 miles there is a good chance your emissions problem is covered under a federally mandated extended warranty.