All of a 529 account's earnings are exempt from federal taxes when they're withdrawn if they are used for qualified education expenses. This means that, unlike the taxes you have to pay on earnings from regular stock investments, you won't pay any taxes on 529 account earnings unless you end up using the money for something other than higher education. Earnings are currently tax-deferred in most states, as well.
A break on the earnings tax isn't the only tax advantage, either. Although your contributions aren't pre-tax (you pay state and federal tax on the money you put into the account), there are some states that let you deduct a portion of your contributions from your state taxes.
One of the nice things about a 529 plan is that qualified education expenses are very broadly defined (much more liberally than with a prepaid tuition plan). Eligible expenses include tuition, room and board, fees, books and even computers. If you need it to study, you can probably use the 529 plan to purchase it.