Edit: (The following is debated because mushrooms can fruit in complete darkness. Light has effects on growth and development but the details require more investigation.)
Mushrooms do not use light in the same way that plants do (for photosynthesis); rather, light is a signal that tells the fungus to start its fruiting stage. In nature, light would tell the fungus that it has reached the outside of a dung pile and that where the light hits it is a good place to create a fruit body.
Most types of light source will work. Indirect sunlight and florescent bulbs (temperature 5500k) both work. When using indirect sunlight, care must be taken to rotate the chamber so all sides get even amount of sunlight, or fruiting will occur more heavily on the sunlit side, thus reducing yield. When using artificial light, a common approach to simulate day and night is to use a simple outlet timer on a 12 hours on and 12 hours off schedule. There is debate as to whether any darkness is needed at all for successful fruiting, however it is not debated that at least 1 or 2 hours of light is needed per day.
The sides of the fruiting chamber should have some method of blocking light from the bottom of the substrate to about three inches above it on the side of the chamber. If this is not done, side pinning and bottom pinning will occur.
(EDIT: Light is not what causes side pins. You should you use a liner in your tub so that the substrate doesn’t have a microclimate around the edges of the container. With the liner holding the sides of the “substrate brick” it will rededuce side pins. I have seen people paint the sides of their tubs to try to reduce side pins but that is just a misunderstanding of why you’re using the liner.)
This is undesirable as it can produce a fruit body that is stunted, as well as bottom and side fruit are often not seen, and allowed to mature, die and rot on the substrate allowing a potent vector for contamination.
Fresh Air Exchange (FAE)
Lower levels of CO2 are also a signal for the mycelium to create fruit bodies. Again, in nature when the mycelium reaches the outside of the dung pile, there is much more fresh air than inside the pile. The more (clean) fresh air you can get into your fruiting chamber the better, so long as you are able to keep the proper level of humidity. Also, some contaminants thrive in stale air with high CO2 levels, so FAE is also important for avoiding conditions favorable to some molds and bacteria.
Depending on the type of fruiting chamber used, there are various ways to achieve optimum FAE. The Shotgun FC was designed to provide FAE by hundreds of holes drilled in all sides. Some cultivators use a fish tank air pump on a digital timer to supply fresh air every other hour or so. Others simply open up the lid and fan with a magazine, but in a dirty grow room, this approach would increase risk of contamination. Some fruiting chambers are outfitted with cool mist or sonic humidifiers in order to provide both FAE and higher relative humidity.
The humidity with a fruiting chamber must remain high in order to encourage pinning and to all the growing mycelium to retain as much water as it can hold. The relative humidity(RH) of the air around fruiting mycelium should be at least 90%. A hygrometer can be used to measure RH, but many experienced cultivators can gauge relative humidity by examining water condensation on the walls of the fruiting chamber. Relative humidity is carefully controlled when a fruiting chamber is used.
The mycelium itself can create and maintain its own humidity relatively well, especially once it has fully colonized and fruit bodies are starting to grow. However, there are many different techniques which can be used to aid in maintaining proper humidity.
Misting with a spray bottle is not a humidification technique in itself so much as a supplement to other primary techniques. Misting is commonly used in order to replenish humidity after fanning for fresh air exchange or to replenish the moisture in casing layers. Mycelium and fruit bodies should never be directly sprayed with water.
High surface area materials like perlite and geolite are commonly used in a fruiting chamber to maintain a maintenance free relative humidity. They are commonly used when fruiting from substrates that lack casing since they will maintain such a high humidity level. They are commonly soaked to saturation, drained and then poured into a fruiting chamber in order to evaporate.
Some cultivators use humidifiers which they pipe into the fruiting chamber. Humidifiers are especially common when using a martha, an indoor green house. Humidifiers both maintain relative humidity and provide air exchange, but are relatively uncommon since other humidification techniques are less expensive and easier to maintain.
Adding a casing layer on top of the substrate will also help to encourage pinning, the development of fruit bodies. When a casing layer is used, the relative humidity of the fruiting chamber can be much lower than without. For this reason, the casing layer itself can maintain proper humidity in fruiting chambers that are covered completely substrate/casing such as a monotub.
Fruiting temperatures should be between 70-79°F (22-27°C), which is slightly lower than the 75-85°F (24-30°C) required during incubation. The mycelium of the mushroom also gives off less heat while fruiting than it did during colonization.
Now that your substrate is colonized, the fungus has gained control over all of the nutrition and will be able to fight off most contaminants like mold and bacteria. However it will still be susceptible to infection if you are not careful.
Before a substrate is put in the fruiting chamber, the chamber should be cleaned with soap and water. A mold infection can be taken care of by wiping the inside out with rubbing alcohol(mixed at 70%), hydrogen peroxide, or both. Once your substrate is inside, the chamber should be able to remain clean. Frequently opening your chamber in an unclean room with dust in the air should be avoided as much as possible. New cultivators often become very excited about their grows and want to open the chamber to look at the mycelium and check for new mushrooms without having their view obscured by condensation on the inside of the chamber. While you should periodically check the health of the fungus by closely examining it, opening the chamber unnecessarily may compromise cleanliness as well as humidity.