Airlines actually do so in lean seasons, or when the time left is too short to fill all empty seats. On one occasion, I was actually perplexed to note that seat available for immediate flight, say after four hours, was cheaper than the seat available in the next flight.
Usually, the demand for last few seats is far more than the demand for first few seats. Businessmen who need to travel on a short notice are willing to pay the premium and airlines exploit this to make up for the losses as a result of selling seats below cost to fill the aircraft.
Ever since flexible pricing system has been introduced, ticket prices change from day to day, hour to hour, and even minute to minute. The system itself is a complex computer algorithm programme that takes into account the number of seats available and the time left to sell them, and, therefore, keeps varying the prices automatically. The prices would tend to be higher if available seats are fewer and there is more time available to sell them.