In this paper we develop new applications of variational analysis and generalized differentiation to the following optimization problem and its specifications: given n closed subsets of a Banach space, find such a point for which the sum of its distances to these sets is minimal. This problem can be viewed as an extension of the celebrated Fermat‐Torricelli problem: given three points on the plane, find another point that minimizes the sum of its distances to the designated points. The generalized Fermat‐Torricelli problem formulated and studied in this paper is of undoubted mathematical interest and is promising for various applications including those frequently arising in location science, optimal networks, etc. Based on advanced tools and recent results of variational analysis and generalized differentiation, we derive necessary as well as necessary and sufficient optimality conditions for the extended version of the Fermat‐Torricelli problem under consideration, which allow us to completely solve it in some important settings. Furthermore, we develop and justify a numerical algorithm of the subgradient type to find optimal solutions in convex settings and provide its numerical implementations.