Tim Dingman (BEN STILLER) and Nick Vanderpark (JACK BLACK) are best friends. Not only do they live across the street from each other with their respective wives -- Debbie (RACHEL WEISZ) and Natalie (AMY POEHLER) -- and kids, but they also carpool together to the sandpaper factory where both work.
Yet, where Tim's performance review shows that he's a good worker -- resulting in his promotion -- Nick's shows that he lacks focus and is something of a dreamer. Thus, it isn't surprising when he suddenly comes up with the idea for Vapoorizer, a spray on application that miraculously causes dog poo to disappear.
He doesn't know how he'll actually make it work, but everyone thinks it's a great idea, except for Tim who refuses to invest $2,000 into the idea. Ever the optimist, Nick continues on his quest and actually manages to create the product. Eighteen months later, the Vanderparks are wealthy beyond their wildest dreams, but have opted to stay in their old neighborhood, albeit with a monstrous mansion. With a bowling alley. And a carousel. And a horse with a "stable" bigger than Tim's house.
Although Nick keeps buying or giving things to Tim and his family, the latter eventually allows his envy of Nick's wealth and lifestyle to drive him crazy. After Debbie decides that she and the kids need to get away from him, and after Tim explodes at his boss and is fired, he ends up meeting J-Man (CHRISTOPHER WALKEN) at a bar. Understanding Tim's plight, the somewhat off-kilter man tells a drunken Tim what he needs to do.
But in doing so, Tim ends up accidentally doing something quite bad. From that point on, and as he tries to cover up that envy-generated incident, Tim and his life start spiraling out of control.