Crystal structure and magnetic properties of substances with orbital degeneracy