One way to mitigate the effect of noise (assuming, like Hilmar, on the output) is to use transfer function estimators. A straight-forward one is:
$$\tilde{H}(\omega) = \frac{P_{yx}(\omega)}{P_{x}(\omega)}$$
where $P_{yx}(\omega)$ is the Cross Power Spectral Density of $x$ and $y$ and $P_{x}(\omega)$ is the Power Spectral Density of $x$. These can be computed in many different ways, such as the Welch method.
Here's why this estimator is better suited for noisy measurements:
In Frequency domain, you have:
$$Y = X\cdot H$$ so you'd be tempted to simply re-arrange to get
$H = \dfrac{Y}{X}$
As Hilmar pointed out though, if there's noise $N_0$ in the output, the resulting estimate is:
$$\tilde{H} = H + \frac{N_0}{X} = H+\frac{1}{\texttt{SNR}}$$
You can see the problem here, the lower the $\texttt{SNR}$, the higher your estimator's bias.
Here comes the frequency averaging estimator: Let's look at the definition of the Cross Power Spectral Density:
\begin{align} P_{yx} &= \mathbb{E}\left[ \overline{X}\cdot(Y+N_0) \right]\\
&= \mathbb{E}\left[ \overline{X}\cdot Y + \overline{X}\cdot N_0\right]\\
&= \mathbb{E}\left[ \overline{X}\cdot HX + \overline{X}\cdot N_0\right]\\
&= H\cdot\mathbb{E}\left[\overline{X}X\right] + \mathbb{E}\left[\overline{X}\cdot N_0\right]\\
&= HP_{x} + \mathbb{E}\left[\overline{X}\cdot N_0\right]
\end{align}
Assuming the noise in the output, $N_0$, is un-correlated with the input, we have $$\mathbb{E}\left[\overline{X}\cdot N_0\right] = 0$$
$$P_{yx} = HP_{x} \implies H(\omega) = \tilde{H}(\omega) = \frac{P_{yx}(\omega)}{P_{x}(\omega)}$$
Of course this is just theory, since the Expected Value Operator $\mathbb{E}$ is a statistical operator based in infinite time. In a practical measurement scenario (finite time, noisy), the cross term $\overline{X}\cdot N_0$ is never actually $0$, but by using frequency averaging (Welch's method) to compute $P_{xy}$, that cross term does go towards 0 since $X$ and $N_0$ are un-correlated, resulting in a better estimate of $H(\omega)$ than simply dividing the output spectrum by the input spectrum.