We study the ratio of harmonic functions u,v which have the same zero set Z in the unit ball $${B\subset \mathbb{R}^n}$$ B ⊂ R n . The ratio $${f=u/v}$$ f = u / v can be extended to a real analytic nowhere vanishing function in B. We prove the Harnack inequality and the gradient estimate for such ratios in any dimension: for a given compact set $${K\subset B}$$ K ⊂ B we show that $${\sup_K|f|\le C_1\inf_K|f|}$$ sup K | f | ≤ C 1 inf K | f | and $${\sup_K\left|\nabla f\right|\le C_2 \inf_K|f|}$$ sup K ∇ f ≤ C 2 inf K | f | , where C 1 and C 2 depend on K and Z only. In dimension two we specify the dependence of the constants on Z in these inequalities by showing that only the number of nodal domains of u, i.e. the number of connected components of $${B\setminus Z}$$ B \ Z , plays a role.