This is The Raft (Wikipedia, ISFDB) by Stephen King, first published in 1982 in Gallery and collected in Skeleton Crew in 1985.
From the summary at Wikipedia:
Four college students named Randy, Deke, Rachel and LaVerne, decide to swim to a wooden raft on a remote Pennsylvania lake to celebrate the end of summer.
While swimming out to the raft in the middle of the lake, Randy notices a mysterious oil slick-like substance floating on the surface that appears to go after the girls as they reach the raft. Deke and LaVerne ridicule Randy's suspicions that the oil slick was chasing the girls until Rachel remarks on the beautiful bands of colors on the slick's surface and touches it. The oil slick instantly coats her finger and pulls her into the water, where it covers her with itself and dissolves her alive. The horrified trio are helplessly forced to watch her die.
[…] During the course of the night, LaVerne convinces Randy that they should sit and watch it together and keep each other warm, LaVerne's hair falls over the side of the raft. Before Randy can pull LaVerne up, the creature manages to tangle itself in her hair and flows over her head, melting her face. Unable to save LaVerne, he kicks her over the side of the raft in a panic, quickening her death.
[…] After night comes, Randy turns to the creature and contemplates that the creature's colors will take the pain out of being consumed. Randy does not look away as the creature shimmers hues at him, and the story ends.