Read this story online a few years back but I am quite sure it was far older, maybe from the 1970s or even earlier.
It has a pair of scientists receiving a transmission from a distant star system. Initially they have trouble deciphering the message, but then they realize it's chemical formulae rather than language or mathematics. They realize that the distant aliens are telling the story of their history in terms of chemistry - the first formula describes the combustion of plant matter (ie the invention of fire) then come formulae about iron making, coal burning, etc. The next sequence of formulae are decoded and turn out to be stuff like gunpowder and eventually nuclear fission, which is repeated over and over which the scientists decide must mean multiple nuclear wars. Finally a set of increasingly complicated formulae are received that our scientists don't recognize, ending in a single formula that they sense must be for something really destructive. Not long afterwards, the distant star explodes. The scientists speculate that the distant aliens who sent the transmission were scientists as well, who knew that their star was about to die and wanted to share their story with anyone, anywhere, and also as a warning.
I initially thought it was by Asimov given the emphasis on chemistry but nothing in his bibliography really jumps out at me.