The correct option is D it gains heat from the hot water and expands
A mercury thermometer is a glass tube filled with mercury. It works on the principle of thermal expansion.
When the thermometer is placed in hot water, the mercury gains heat from hot water and expands to a greater volume.