Here's what our high school biology curriculum says about this. I'm not sure exactly what you know and don't know, so I'm just going to copy the whole section. If you need more, less, or a different explanation, just let me know.
Gene expression actually starts with the transcription of the DNA molecule. The DNA in the nucleus can be either unwound in very thin threads or tightly coiled. In fact, a single strand of DNA can have multiple areas that are coiled and areas that are uncoiled. Only the areas that are uncoiled can be transcribed. Proteins in the nucleus bind to regulator sites on the DNA that cause it to uncoil, allowing it to be transcribed. Each gene has it own set of regulatory proteins and control sequences that initiate the transcription process that form mRNA.
The proteins that are produced by the translation of the mRNA by the ribosomes in the cytoplasm may be used within the cell's cytoplasm or organelles, transported to other cells, or returned to the nucleus. If a cell has an abundant supply of a particular protein, the DNA stops manufacturing the mRNA responsible for that protein until the excess is depleted.
Sex-limited characteristics are the results of gene expression. The presence or absence of sex hormones turns on or off the genes that code for these characteristics. The feathers of some male birds, brightly colored when compared to those of the female of the same species, are a sex-limited characteristic.
An example of an external environmental control is the Himalayan rabbit. During the winter the Himalayan rabbit is normally white with black ears, nose, tail, and feet. If, however, the hair on his ears and tail is removed and these parts are kept in heated mufflers white his winter coat regrows, the fur will regrow white. If an area of the rabbits back is kept cold while his hair is growing, the hair will be black. In this example, temperature turns on or off the gene for coat color.
Thanks 'Member. I guess what I want to know, is how temperature turns on or off the gene for coat color. The mechanics of it. I've seen evidence for this sort of thing, and MB you and I have had conversations about bee colonies who were under pest pressure and it was like a "switch flipped" within the colony that changed the outcome from not-survive to thrive. Because of (presumably) a change in behavior, which is correlated to a (again presumably, based on the models we have) change in expression of genes.
This particular article is talking about how the presence/absence of QMP and brood pheromones causes anatomical change of some workers to start laying eggs. Which is a genetic expression. I think that it's pretty neat and don't know the mechanics of it. Turns out there's a whole lotta things I don't know how they work, in fact.
I'm going to retread a little ground here, but just hear me out. DNA is the code that tells the cell what proteins to make, and proteins are essentially the pieces that make up all the cells, and the cells the pieces that make up the body. But the DNA is just the blueprint, the cell has to be triggered to use the blueprint to make whatever it needs. The thing to remember is that the DNA holds the blueprints for EVERYTHING the cells may EVER need to make. For example, both sexes of humans have the genes that code for facial hair growth, but women's cells aren't triggered to read that gene. So the cells need to be told what is needed at any given time. That trigger can be many different things, temperature in the case of the rabbit fur, in the case of facial hair it's hormones, and in the case of the bee example you ran into it's pheromones.
Each gene has it own set of regulatory proteins and control sequences that initiate the transcription process that form mRNA.
This is really the key statement from my textbook. Each section of the coiled DNA in the nucleus is triggered to be uncoiled by different factors. When that section of the blueprint is uncoiled, it can be "read" by the cell. The DNA is too valuable to remove from the nucleus, so the cell makes a copy of the section it needs by making a strand of RNA that matches up to the DNA. (I can get into more detail of this process if you want; it involves all that base pairing up that you may remember from school. It's not super critical to your question though.) That RNA is then taken out of the nucleus and into the cell's cytoplasm where the ribosomes get to work making whatever the RNA codes for. That can be a black patch of fur instead of a white one, a beard instead of the normal vellus hair that covers the rest of the body, or it can be a functioning reproductive tract instead of a dormant one in the case of a worker bee who is no longer exposed to QMP or brood. So the environmental change is what triggered the cells to read the section of DNA that had the instructions for doing something new. Does that make sense?