How does partisan regulation of political markets affect elections? We investigate how the partisan control of ballot format, which is expressly regulated - often to the apparent advantage of incumbents and major parties - in all U.S. states, affects voting. Through the analysis of a unique natural experiment, we focus specifically on the longstanding question of whether the name order of candidates on ballots affects election outcomes. Since 1975, California law has mandated randomizing the ballot order with a lottery. Previous studies, relying overwhelmingly on observational data, have yielded largely conflicting results. Using improved statistical methods, our analysis of statewide elections from 1978 to 2002 reveals that ballot order might have changed the winner in twelve percent of all primary races, including major and minor party races. We propose that all electoral jurisdictions should randomize ballot order to minimize ballot effects, and show that randomization may be substantially more cost-effective at reducing voting bias than currently proposed voting technology reforms.