I used to live in Maryland. My first advice is GET OUT! Failing that, the most common reason a car will fail a smog test is that the engine is not fully warmed up. Put some new spark plugs in the car, then drive it, hard, for at least 20 minutes immediately before the smog test.
Let us know how that turns out. Once you've passed the smog, you get to deal with Marylands' rather anal vehicle inspection.