It depends on who you ask and whether you adjust for inflation or not, either way Pirates of the Caribbean: At World's End is actually the most expensive film ever made, Avatar "officially" (whatever that means) cost $237million, POTC:AWE topped $300m. In the non-adjusted figures Avatar is only 4th (Spider-Man 3 and Harry Potter and the Half Blood Prince both cost more, supposedly).
Avatar's going to be difficult to calculate though, it's been in development for 15 years and the final figure won't necessarily include the costs of developing all the technology required to shoot it.