It's called "diffraction grating" and here is the complete answer from "The Atlantic" and also the USDA's website
Beef rainbows aren't a sign of spoiled, tainted, or (sorry) magical beef. There's enough speculation over the integrity of rainbow beef that the USDA's website has a section on "Iridescent Color of Roast Beef" near similar topics like "What does 'natural?' mean" and "what is beef?" According to the USDA, "When light hits a slice of meat, it splits into colors like a rainbow." This is something called a "diffraction grating," essentially what happens when light waves bend or spread around a surface and create a pattern. It's the same thing that happens to make rainbows on the surface of a DVD. It's understandable that folks mistake diffracted light as a sign of spoilage, especially since the main color created by meat diffraction gratings is green. There is a reason why in Dr. Seuss's Green Eggs and Ham, the central conflict of the protagonist is his strong apprehension against eating green meat.
Speaking of ham, beef is not the only meat known to have rainbows. However, when cooked beef is sharply sliced against the grain of the muscle fiber, this, coupled with the moisture in the beef, creates an excellent surface for producing rainbows. "In my opinion," Dr. Thomas Powell, Executive Director of the American Meat Science Association, told me, "The reason it shows up in roast beef is because the cuts of meat that are used in most roast beef are more prone to iridescence, particularly in the round," hence the reason why the USDA singles out roast beef as being especially colorful.