Once an opened container of pasteurized milk is a few days past its expiration date, you can expect it to smell and taste a bit sour. After a week or so, it will taste extremely sour. At some point, it will even develop chunks. Gross! But if it’s pasteurized, which kills the germs in the milk, what is it that actually causes the milk to go sour? Isn’t it bacteria that cause milk to spoil? Where do the bacteria come from?
Sterilization Versus Pasteurization
The key to understanding why your milk goes sour is to learn the difference between commercial sterilization and pasteurization.

Sterilization destroys all pathogenic and toxin-forming organisms and any type of organism that could cause spoilage in the product. Commercially sterilized foods are not necessarily sterile as they may contain a number of bacterial spores that are particularly heat resistant. These will most likely not multiply or cause any problems.
An example of a commercially sterilized food is any canned food. While canned foods are said to have a shelf life of two years, this is not because they spoil (unless the can is compromised) but because of other types of flavor and texture changes. They may remain safe to eat indefinitely.
Pasteurization uses lower heat than sterilization, typically lower than the boiling point of water. The goal of pasteurization is not to sterilize milk or other products but to extend the shelf life and destroy certain pathogenic organisms that could multiply and make people sick.

However, pasteurized products, including milk, can still contain many other organisms capable of causing spoilage, including off-odors and off-flavors. In milk, the organisms responsible for this are usually various species of Bacillus and Lactobacillus bacteria.
Difference Between Spoilage Organisms and Pathogenic Organisms
Spoilage organisms are not the same as pathogenic orgasms. The bacteria that cause your milk to taste sour are fermentation bacteria that produce lactic acid. Bacteria such as salmonella, while they make you sick, do not contribute to spoilage.
First, I need to address some internet rumors that “modern milk doesn’t go sour it goes rotten.” While there is a kernel of truth to this, it is not the whole story. During pasteurization, which is meant to kill harmful pathogens, some bacteria survive.
Some of these may be lactic acid bacteria capable of withstanding heat shock. If these bacteria are also psychotropic, they will be able to slowly grow in the milk. An example is Lactobacillus lindneri, which can survive high heat and can also multiply, albeit slowly, in cold temperatures. The presence of this bacteria and any other lactic acid bacteria will cause milk to go sour. When this happens, it is due these bacteria metabolizing the lactose sugar in milk and producing lactic acid as a byproduct. this produces the sour taste and smell.
The presence of more acid lowers the pH of the milk and begins to change the structure of the casein protein, producing curds or what we perceive as nasty chunks.
Some of the same type of bacteria that sour your pasteurized milk, Bacillus and Lactobacillus bacteria, are used intentionally to make yogurt, buttermilk, or other fermented products.
However, pasteurized products, including milk, can also contain many other organisms capable of causing spoilage, including off-odors and off-flavors. These will not ferment the lactose in the milk but instead are proteolytic. They break down the milk proteins. So, they spoil the milk or cause it to go rotten. An example is Thermoduric psychrotrophic bacteria. These are gram-positive bacteria can survive pasteurization because they have dormant spores that can withstand extreme conditions. The pasteurization process can wake up these spores and since the bacteria don’t mind the cold, they will grow in refrigerated milk.
These and other “spoilage” bacteria can produce enzymes that break down the proteins, fats, or lecithin in milk. Different bacteria have different effects on the milk, all contributing to the overall condition of the milk as it ages.
In addition to the sourness caused by lactic acid bacteria, some bacteria produce putrid, bitter, fruity smells or taste. They also can make the milk seem slimy and stringy. Other bacteria can produce a sweet curdling, caused by bacteria that produce a substance similar to renin used to make cheese so that the milk curdles without the addition of acid. Together, all these changes lead to varying off-flavors and smells in spoiling milk.
The spoilage organisms in milk are not necessarily harmful to you, although you probably would feel quite ill from drinking spoiled milk.
There are also some pathogenic bacteria that are at home in colder temperatures and it is possible that by the time milk becomes quite rotten, some harmful bacteria could have gotten into the milk and multiplied in sufficient numbers to give you food poisoning
Sealed pasteurized milk is therefore free from harmful bacteria but not from spoilage bacteria. This is why you must keep it refrigerated, except in the case of unopened shelf-stable ultra-pasteurized milk stored in aseptic cartons. If you store pasteurized milk at room temperature, even unopened, it will sour within a few days. Refrigeration retards the spoilage but does not arrest it.
As I mentioned, as you open the container of milk to pour some out, it is possible for other mystery organisms to get in the milk. Even with refrigeration, these organisms may multiply over time.
If the milk is left unopened for an extended period, the possibility of unknown organisms getting into it is even greater. So, while milk that is soured or otherwise spoiled should not be considered all that dangerous, it is probably not a good idea to consume sour milk unless it is heated. as when used for cooking.