There is one problem in a concert that starts with Bach's Trio Sonata and Ricercare from "The Musical Offering": Where do you go from there? How can you follow these masterpieces of the Baroque with anything that will not be anticlimactic? The Chamber Music Society of Lincoln Center set itself this problem last night in the Kennedy Center Concert Hall, and then solved it neatly. The 18th-century masterpiece was followed by comparable masterpieces of the 19th and 20th centuries: the Brahms Piano Quartet in G minor and the Shostakovich Piano Trio in E Minor.

There was also, for contrast, one minor and relatively unknown masterwork: the Caprice on Danish and Russian Airs, Op. 79, by Camille Saint-Sae ns. It injected a substantial measure of wind-instrument flavor into a sequence that was otherwise dominated by the sound of piano and strings, and a bit of lightness between the intense brooding of Shostakovich and the almost manic-depressive mood swings of Brahms. It also paid brief but fitting tribute to an anniversary that has been almost ignored this year amid the tricentennials of Bach and Handel: the 150th birthday of a composer who was born in 1835 and remained creative well into the 20th century.

The Caprice is a little work, but perfect of its kind. It blends pure melody, intertwined or passed back and forth by flute, clarinet and oboe, with passages of brilliant virtuoso display. Flutist Paula Robison, clarinetist Gervase de Peyer and oboist Leonard Arner took full advantage of the opportunities it offered, as did Charles Wadsworth at the piano.

For the Shostakovich, pianist Richard Goode was joined by violinist Ani Kavafian and cellist Fred Sherry in a superbly coordinated, deeply emotional reading of a work that was most eloquent in its quietest moments. In the Brahms, violist Walter Trampler joined the ensemble for a performance that sometimes put emotional fervor before perfection of ensemble sound, with results that brought the audience to its feet at the end. Sherry's cello was sometimes hard to hear at moments when everyone was playing at full volume, but the intensity of expression -- and the sheer technical brilliance of the Gypsy-style final movement -- made such considerations seem unimportant. This was chamber music-making at the highest level, free in expression and superbly responsive to the music's subtly shifting moods.