Masonry is primarily susceptible to two problems, cracking and efflorescence. Efflorescence is the white powdery substance that bubbles up on masonry surfaces like basement walls. It happens when moisture penetrates the surface causing the alkali salts in the portland cement to leaches out and deposit on the surface.
If moisture is a constant problem, that issue will have to be addressed before using this process for curing an efflorescence problem. Check downspouts and drains for the source of water damage. If the ground slopes in toward a wall, mound it up so water will run away from the building.
To remove alkali efflorescence from masonry, use a weak solution of muriatic acid and water. Be very careful with the acid, it is very corrosive and will burn everything, including skin. Even a minor splash of the acid solution can do damage so wear long sleeves, gloves and eye protection. Use a nylon bristled brush to scrub very gently to minimize splashing.
Rinse the acid from the surface using lots of clean water. Watch the run–off; soak it up with absorbent rags and wipe all surfaces down well to prevent the acid from damaging things like adjacent floors and vegetation. Most of the time this acid treatment will cure the efflorescence problem but if necessary, you may have to repeat the process a second time.
If you're going to deal with efflorescence on an interior surfaces where you don't want to use a dangerous acid, try using a strong vinegar solution in place of the muriatic acid. Boil a cup of vinegar down to a half cup. This will double the normal acid in the vinegar which may be effective on many minor efflorescence problems.
To paint the surface let the treated area dry well if you're using anything other than a latex based coating. Latex can go over a damp surface and in fact, the masonry should be a little damp to make painting easier and improve bonding. See Painting Masonry for more about applying coatings to masonry surfaces.
To repair cracks in foundations, walls, slabs and walkways first be sure the movement that caused the crack has been stabilized. If the movement causing the crack is minimal, it may be possible to fill it with masonry caulk that will move with the crack for a permanent seal. If the movement is more severe it may be necessary to reinforce the footer or foundation to stop movement. Multiple cracks, like those pictured, are an indication of major problems with the stability of the structure.
Prepare the crack for repairs using a putty knife or screwdriver to scrape out all loose material. Hose out the crack if possible, if not, use a shop vac or compressed air to remove all debris. Soak the crack completely using a spray bottle when working inside and a hose on exterior cracked surfaces. Saturate the masonry well just before applying the mortar patch. If a crack dries out before the mortar is applied, soak it again. You can't get it too wet but if it becomes too dry the new patch will not bond well.
Use a pre–mixed bag of mortar or mix your own using one part portland cement and three parts very fine sand. Use the finest sand you can get from your local home store to make your patch mortar bond well with the old masonry. Mix the cement and sand well and then add water to make a thick mud that holds its shape.
Use a putty knife to press the mortar into the crack starting a one end. Press mortar into the crack until it starts to ooze back out. Do this along the entire length of the crack and then go back to scrape off the excess. Finish the repair by applying a smooth coat of mortar to level the masonry surface along the crack. As you work keep the masonry surface around the crack damp with a spray bottle of water if necessary. After the repair is completed use a spray bottle of water to keep the patch damp for about 3 days until it has dried.