Buying a ticket in advance is the best way to guarantee a better rate. Rates begin to fall when you purchase your ticket at least 15 days in advance. Most travel websites consider a ticket purchased 15 days before departure an "advance ticket." The ticket price then decreases further about every seven days.
Choosing optimal times and dates to fly is just as important as buying a ticket in advance. According to the Sunday Times, "No-frills flights are always emptier (and cheaper) midweek, since few of their passengers are business travellers. If you must travel on the weekend, go Saturday to Monday instead of the ever-popular Friday to Sunday." When traveling on popular days, such as around the holidays, consider flying before the rush begins or on the holiday itself.
The Internet is full of websites dedicated to booking airline tickets. Many websites will research flights and assist in booking with no booking fees. This can be very useful because the websites can continuously check rates to determine the best time to buy. Most sites will happily email you when the price is right.