Why do prices end in .99?
Because it works to maximize profits. Why? Market demand does not react to difference in the cent digits of a price.
Why does our brain ignore the .99?
The basic idea is the assumption that consumers use a heuristic to calculate, compare and memorize prizes, due to their limited brain-capacity to process prices exactly: they read prices from the left and, in particular, they disregard cent prices. As a result of this boundedly rational behavior, the consumers tend to overestimate the gap between prices differing only by a small amount, if the lower price has a smaller left digit (e.g.: 3.00 vs. 2.99).
The findings of the paper:
In this paper we present the first comprehensive and consistent analysis of price points on the supply and demand side of a market. We analyze the issue in the context of e-commerce, an environment that is, a priori, not very favorable to price points. Our results are consistent with Basu (2006) who assumes boundedly rational shoppers ignoring the rightmost digits due to limited processing capacity. Profit-maximizing firms will adapt by setting prices ending in 9s. We find that market demand does not react to differences in the cent digits, as Basu (2006) is assuming. Moreover, odd prices show typical equilibrium characteristics: they are more sticky than regular or even prices. This is particularly so for best-price offers: when these offers end with 9, they are less likely to be undercut by the rivals, they are also less often changed by the firm itself.
If you're interested in human heuristics around pricing, William Poundstone wrote an awesome book on the subject: Priceless: The Myth of Fair Value (and How to Take Advantage of It)