  Let $X$ be the prime spectrum of a ring. In [arXiv:0707.1525] the authors
define a topology on $X$ by using ultrafilters and they show that this topology
is precisely the constructible topology. In this paper we generalize the
construction given in [arXiv:0707.1525] and, starting from a set $X$ and a
collection of subsets $\mathcal{F}$ of $X$, we define by using ultrafilters a
topology on $X$ in which $\mathcal F$ is a collection of clopen sets. We use
this construction for giving a new characterization of spectral spaces and
several new examples of spectral spaces.
