Thick haze blots out snowy mountains just 20 miles away. Schools cancel outdoor recess when the soot and ozone in the smoggy air reach dangerous levels. Asthma doctors are stunned at the record number of youngsters gasping for breath.

This isn't a Rust Belt steel-town or car-clogged Los Angeles. It's the verdant San Joaquin Valley, a 240-mile-long stretch of farmland from Stockton to Bakersfield, with some of the nation's worst air.

While California's skies have cleaned up in recent years, the valley's skies haven't. The American Lung Association put three San Joaquin counties -- Kern, Fresno and Tulare -- in the top-six most-polluted counties in the nation.

For a decade, regulators and politicians have dawdled while the heavy air settled into a near-permanent lid over the region. Finally, the first steps toward cleaning the skies are being taken, though it will take up to a decade to test the results.

It's a shameful record that punishes the state's poorest residents. Set against the prosperous image of California, the eight counties making up the valley are impoverished stepchildren.

The valley's jobless rate is more than double the state average. Its residents have less schooling, income and life expectancy than those in other parts of California. The valley leads the rest of the state in one dismal social barometer: It hosts the highest number of prisoners, thanks to a construction boom of state prisons welcomed by job-hungry towns.

Neglect and timidity postponed smog solutions until now. But harsh publicity over asthma rates and lawsuits brought by environmental and civil rights groups are prompting change. The results bear close monitoring to make sure the air improves.

The valley runs on a puzzling paradox: Vistas of green cotton fields and neatly-fenced dairies matched against filthy, yellow air. How did prime farmland become so polluted and who is responsible?

Local smog officials claim the issue is complex. Highway 99 and Interstate 5 rumble with truck traffic powered by federally regulated diesel engines. Cars and pickups using state emission rules commute to work from sprawling subdivisions stretching from Tracy to Bakersfield. As a result, the valley's smog board has no say on tailpipe emissions responsible for up to 60 percent of the region's bad air.

Adding to the atmospheric brew is the Bay Area, a source of smog that blows through gaps in the Diablo range and into the valley, totaling up to 27 percent of the smog at the north end.

A pending state bill would require higher smog-check standards for Bay Area drivers to alleviate this problem. This is a sensible improvement that removes a favorite valley gripe, blaming outsiders. But cleaner Bay Area vehicles won't solve the inland area's homegrown smog problems.

The valley is also a victim of topography. Mountains rim it on three sides, holding in pollution. Its famously warm weather works to bake a mix of pollutants into ozone that clogs the skies and stays put. High pressure zones and inversion also act to trap dirty air.

Currently, the biggest wild-card in boosting air quality is farming. Agricultural activities -- ranging from diesel water pumps to road dust kicked up by tractors -- have few controls.

Since the federal Clean Air Act was passed in 1970, farmers have enjoyed an exemption from emission rules faced by power plants, auto body shops or factories. Oil extraction, centered in Bakersfield and Coalinga, also holds an exemption.

Pushed by environmental groups and health groups, the U.S. Environmental Protection Agency earlier this year won a court ruling ending the farming exemption and obliging big agriculture operations to line up for clean-air permits. But setting such standards will be a political and technical challenge.

Valley farming is a $16.5 billion industry that produces a tenth of the country's fruits and vegetables, exported across the country and overseas. But it also pours out a fifth of the valley's smog-causing pollutants.

Along with engine emissions, farming churns up particulates, speck-sized dust one seventh the width of a human hair. These tiny strands can add to smog and lodge in breathing passages, causing respiratory problems such as asthma.

But the diversity of agriculture with some 200 crops makes for a regulatory challenge. Farm combines costing $250,000 apiece can't easily be retrofitted with cleaner engines. Harvesting techniques in one corner of the valley may be benign compared to the same activity near homes.

Changes in agricultural practices pose special problems. Huge "manure lagoons" created by a new wave of mega-dairies with 5,000 milk cows may need to be covered to prevent ammonia from escaping into the air. But a recent study by the National Academy of Science said not enough was known about the side-effects of big dairy operations and more research was needed.

Farming groups also complain that global competition has never been tougher for commodities ranging from garlic and almonds to asparagus, once valley money-makers. Lay on new pollution-control costs, and many farmers may give up and sell to real estate developers.

But barring court appeals, change is on the way for valley farming. Its practices clearly need review by regulatory agencies to see if emissions and lung-harming dust can be moderated. The problem of dirty valley air is too huge to allow one major player to escape scrutiny.

For the past 10 years, as the valley's air soured, little was done. Beginning last year, a battery of lawsuits brought by environmentalists and civil rights groups prodded the slumbering federal EPA to oversee local policymakers.

Real choices, with the potential to clean the skies, are now on the table. What's needed is a realistic timetable on reducing smog.

Currently, the valley is holding to a plan to reduce pollution by 30 percent by 2005. But local regulators claim that the figure can't be achieved without drastic steps such as industrial shutdowns or no-drive days. These are steps that would harm the region financially and enrage residents.

Local leaders have fashioned an alternative: stretch out the air-cleaning steps over the next 10 years. To do this, the valley smog authorities need to declare that air quality has worsened from severe to extreme. It's a humiliating designation that admits the region has sunk to the bottom bracket of public health.

This downward step, in effect, says that conditions are so bad that they need extra time to cure them. The lower rating will mean special review by federal authorities, who aren't popular in the valley.

It may chase away new industry, but the chief advantage is that it buys the valley time for cleaner engine technology, lower-emission fuels and changes in farming practices. More public transit, land-use planning to curb sprawl and effective regional government must also be in the mix.

Like any promise to reform, this pledge to clean the air demands scrutiny. Residents, who have made pollution a top concern in polls this year, must pressure elected leaders for results.

Watchdog groups, including environmentalists and health advocates, should keep the heat on local and federal authorities for measurable improvements. Farm groups, vital players in any solution, need to accommodate change, not fight it.

With so many contending groups, cleansing the valley's air will be a battle.

But the problem can no longer be ignored or pushed off indefinitely as it has in the past.

'FRESNO EDDY' SWIRLS VALLEY SMOG

California's 240-mile-long San Joaquin Valley has some of the smoggiest air in the nation. Strong winds and sharply ascending mountains to the east trap air pollution in the valley.

Mountains limit air flows into and out of the valley. Most air entering the valley travels through the Bay Area, where it picks up pollutants.

Cool winds from the mountains cause air to move in a circular pattern, or eddy, preventing pollutants from dissipating outward. Layers of warmer air above the cool air also hinder pollutants that would otherwise disperse upward.

During the summer, winds flow in a south-southeasterly direction, allowing some air to escape.