The present paper is concerned with the dynamics of a magnetic field consequent on three-dimensional large-scale motions of an inviscid incompressible homogeneous perfectly conducting rotating fluid concentrated in a spherical layer. The proposed mathematical model of the above physical process is a closed system of partial differential equations consisting of hydrodynamic equations with due account of the rotation, the Lorentz force, and the corresponding equations of magnetic dynamics with required boundary conditions. We analyze the mathematical model which can be used for calculation of three-dimensional motions with large time scale and when the space horizontal scale is comparable to the layer radius. The principal idea of our approach is in the construction of a scheme of successive approximation, in which the geostrophic approximation is the first step. Our approach allows one to go beyond the heuristic arguments and derive general geostrophic equations describing the motion of both homogeneous and inhomogeneous electrically conducting rotating fluid. We obtain an analytic solution of the system of nonlinear partial differential equations that model the geostrophic motion in the spherical layer of perfect electrically conducting inhomogeneous rotating fluid. The analysis of the structure of the above fields of magnetohydrodynamic quantities allows one to justify the existence of strong changes in the thing layer adjacent to the outer boundary.