When you do something in a serious or sad way, you do it somberly. If you're giving a friend bad news, you'll probably deliver it somberly.
Mourners in a funeral procession walk somberly, and someone hearing a sad story will listen somberly. This bleak and solemn adverb comes from the adjective somber, which means "serious" or "dark and dull in color," and is from the Old French sombre, "dark and gloomy." The Late Latin root is subumbrare, "to shadow."