With Buffalo trailing 14-13, Greer picked off a Trent Green pass over the middle on the first play of the fourth quarter and ran 33 yards for the score that put the Bills ahead to stay.
Buffalo is unbeaten in four games and the Rams (0-4) have lost eight straight contests going back to the 2007 season.
Trent Edwards passed for 197 yards and a touchdown and Marshawn Lynch ran for 57 yards on 19 carries for the Bills. Fred Jackson added a touchdown run and Lee Evans caught two passes for 88 yards and a score.
Green, who started in place of the demoted Marc Bulger, was 17-for-32 for 236 yards, with an interception.
Steven Jackson ran for 110 yards and a touchdown for the Rams.