Combinations and recombinations, the familiar and the strange, the chance to find something new within old songs, the camaraderie among musicians onstage and between longtime performers and loyal fans — all the jam-band elements were in place when Phil Lesh and Friends played the last of 10 area shows, the second of two concerts at the Brooklyn Academy of Music on Tuesday night.

It was nearly a new band. Mr. Lesh, the Grateful Dead’s bassist, used two different lineups in two four-night stands at the Capitol Theater in Port Chester, N.Y., and yet another lineup in Brooklyn; only Mr. Lesh and the drummer, Joe Russo, were in all three. For Brooklyn, Mr. Lesh also had Warren Haynes (who toured with the latter-day Dead) and Jackie Greene on guitars and John Medeski on keyboards. They were well rehearsed; the concert’s second set included “Terrapin Station,” a suite full of tricky ensemble passages.

The same band as in Brooklyn — except with the guitarist John Scofield instead of Mr. Greene — is to perform on May 28 at Rumsey Playfield in Central Park.

The many configurations of Phil Lesh and Friends since Mr. Lesh began touring under that name in 1998 have given him the opposite of what he had with the Dead, which had a stable core membership for decades. Mr. Lesh plays bass as he always has: not as a riffing foundation for a rhythm section, but as a low, ambling, compatible counterpoint to the rest of the band. Revisited by Mr. Lesh’s various Friends, the Dead catalog (along with other songs) continues to metamorphose, and on Tuesday night the group pulled in some welcome, unexpected directions.