Apple iPhone 3GS Battery Problem
The solution is likely to get the battery replaced.  By Apple or a qualified repair service.  

Li-Ion batteries behave like this when the chemistry fails due to normal use or a premature fault.  The voltage can suddenly drops off a cliff, too fast for the battery charge indicator to show the decrease in percentage.