Floor squeaks are caused by loose floorboards and framing members that move and rub against each other as you walk across the floor. The noise comes from wood rubbing on wood or wood rubbing on nails. It's most common in winter when homes dry out during the heating season. As wood dries, it shrinks, and gaps open up. A common 1 by 6 could shrink as much as 1/16 inch across its 6-inch width in going from damp summer conditions to dry winter heating conditions. If you have the access, you can work on your floor from the basement below. When the squeaks occur, have someone walk on the offending floor while you listen for squeaks and inspect the area for movement in the basement. Mark the problem areas.
If you can reach the joists and subflooring in the squeaking area, your best fix is to "sister" a 2 by 4 or 2 by 6 to the side of the joist and tight against the sub-floor. "Sister" is a carpentry term meaning that the 2 by 4 is parallel to the joist with the wide, flat surfaces together.
Use a short length--18 to 36 inches--and liberally apply construction adhesive to two adjacent 90-degree sides. Construction adhesive is dispensed from a caulking gun and has a caulk-like consistency. You then attach this board to the joist and the subflooring with several screws or nails driven into the joist at an angle.
The construction adhesive will effectively weld the wood to the joist and the subfloor, preventing movement. The adhesive fills voids and will not release as the wood shrinks and moves. Construction adhesive is the key--it will not shrink as it cures. Use as many short lengths as you need to stop the movement and squeaks.
Although many home improvement books recommend driving small shims between the joists and floorboards, I think this can complicate the problem. How far do you drive the shims into the gap? If you drive them in too far, you can loosen the subfloor.
Two products on the market work well to eliminate floor squeaks. Squeak-Relief from Accuset Tool Co., Troy, MI, provides a small aluminum bracket and specially sized screws. The bracket takes the place of the 2 by 4. It effectively secures the floor to the bracket and the joist.
Squeek No More from O'Berry Enterprises, Crystal Lake, IL, works from above the squeak through carpeting or hardwood flooring. It is a special bracket that holds and drives a long notched screw. Once driven into the offending area, the screw disappears. The bracket ensures that the screw is driven to the right depth. Then you use the bracket to break off the head and shank of the screw just below the wood. If you use this on a finished wood floor, it will create a tiny hole that should be patched with wood putty.