In a manner expressing smug satisfaction or delight in another's misfortune.
From gloating (present participle of gloat) + -ly (adverb suffix). The adverb modifies verbs and adjectives to describe how the gloating is done.
The -ing form (gloating) converts the verb to an adjective, then -ly converts that to an adverb—a beautiful chain of English suffixes transforming a verb into a modifier. You can hear the smugness in the sound itself.
Complete word intelligence in one call. Free tier — 50 lookups/day.