Consider two Brownian motions $B^1_{s_1}$ and $B^2_{s_2}$, each taking values on an interval $\lbrack 0, a_i \rbrack, i = 1, 2$, with absorption at the endpoints. The time evolution of the two processes can be controlled separately: i.e., we can alternate between letting $B^1_{s_1}$ run while freezing $B^2_{s_2}$ and letting $B^2_{s_2}$ run while freezing $B^1_{s_1}$. This results in a switched process that evolves in the rectangle, $D = \lbrack 0, a_1 \rbrack \times \lbrack 0, a_2 \rbrack$ like a horizontal Brownian motion when $B^2_{s_2}$ freezes and like a vertical Brownian motion when $B^1_{s_1}$ freezes. Let $f(x_1, x_2)$ be a nonnegative continuous payoff function defined on the boundary $\partial D$ of $D$. A control consists of a switching strategy and a stopping time $\tau$. We study the problem of finding an optimal control which maximizes the expected payoff obtained at time $\tau$ (stopping in the interior results in zero reward). In the interior of the rectangle, the optimal switching strategy is determined by a partition into three sets: a horizontal control set, a vertical control set and an indifference set. We give an explicit characterization of these sets in the case when the payoff function is either linear or strongly concave on each face.