How were atoms able to form after the big bang? How where atoms able to form after the big bang? From my understanding all the materials to form atoms were floating around and by random chance they collided and created atoms. If the universe was quickly expanding after the big bang, would the materials to form atoms be spread too thin. I am assuming that the materials would be spread very thin, since the universe was in existence for a long time before the first atoms were created.
 A: The thrust of your dilemma is that the universe would expand so much, that by the time particles cooled sufficiently for them to combine, the density would be so low that they would never interact?
That is demonstrably not the case, even without considering the clumping effects caused by gravity that later ensure that there are concentrations of matter; we know that we have atoms as well asw
galaxies, stars etc. The solution - at the epoch when the universe cooled sufficiently for protons to capture electrons, a typical electron could interact about $10^8$ times with a proton in the time it took the universe to expand significantly.
Details:
The average baryonic matter density in the universe today is about 0.2 atoms per cubic metre, most of which are hydrogen. The (re)combination of protons and electrons took place when the universe cooled to about 3000 K, at a redshift of about $z=1100$, when the density of the universe was larger by a factor of $(1+z)^3$. Thus the number density of protons and electrons was about $n \simeq 3\times 10^8$ m$^{-3}$ at that time.
Now let's say that an electron has to get within $10^{-10}$ m (about twice the Bohr radius) to interact with a proton. So the cross-sectional area for the interaction is $\sigma \simeq \pi \times 10^{-20}$ m$^2$.
The mean free path of an electron (we can consider the protons as stationary targets because they have similar kinetic energy but 1800 times the mass) is $1/n\sigma \simeq 10^{11}$ m.
This sounds a lot, but travelling at average speeds of $\sqrt{3k_B T/m_e} = 4\times 10^5$ m/s, the average electron will interact every $3\times 10^5$ s.
This is a tiny fraction of the 400,000 year age of the universe at the time of recombination, but more importantly, it is much smaller than the characteristic expansion timescale, which is given by $a/\dot{a}$, the reciprocal of the Hubble parameter at that time.
The Friedman equations tell us that the Hubble parameter was much larger back then. Assuming matter dominated the energy density (reasonably good at tis redshift)
$$H(z) \simeq H_0 \Omega_M^{1/2} (1+z)^{3/2},$$
where $H_0 \simeq 70$ km s$^{-1}$/Mpc is the current Hubble parameter and $\Omega_M\simeq 0.3$ is the present matter density of the universe expressed as a fraction of the critical density.
Thus at recombination $H(1100)\simeq 1.4\times 10^6$ km s$^{-1}$/Mpc and the expansion timescale $H(1100)^{-1} \simeq 2\times 10^{13}$ s. Thus the average electron can interact $\sim 10^8$ times with a proton before the universe expands significantly.
A: There is an important difference between the first atomic nuclei and the first atoms forming. Nucleosynthesis began when the temperature cooled enough that nuclei were not immediately disrupted by free-flying photons and nucleons, and ended when the temperature and density became too low to allow fusion processes (a few minutes after big bang). 
At this point the temperature was still too high for atoms to form: any electron that ended up bound to a nucleus would nearly immediately be bumped away by a high-energy photon. The result was that the universe remained a plasma of free nuclei and electrons. It took until the era of recombination about 378,000 later for the temperature to become less than 3,000 Kelvin, when atoms could properly form. Since nuclei and electrons are oppositely charged they could easily find each other even at the recombination era densities.
If we assume everything is just hydrogen, and use $x$ to denote the free electron fraction (also equal to the fraction unbound protons) the Saha equation for the relative abundance equlibrium reads $$\frac{x^2}{1-x}=\frac{1}{n_H + n_p}\left ( \frac{m_e k_B T}{2\pi \hbar^2}\right) ^{3/2} e^{-\frac{E_I}{k_B T}}$$ where $m_e$ is the electron mass and $E_I=13.6$ eV the ionization energy of hydrogen. The temperature behaves as $T=2.728(1+z)$ K as a function of redshift and the density also conveniently behaves as $n_p+n_H = 1.6(1+z)^3$ per cubic meter. If you solve it for $x=1/2$ you get the time for recombination, $z\approx 1500$. 
For the purpose of the question the interesting thing is that it doesn't matter how fast the redshift $z$ changes. In a universe that expanded slowly (a long period going from $z=2000$ to $z=1000$) the recombination would have proceeded just like a rapidly expanding universe - as long as the expansion was not so fast that there was no time to reach equilibrium. 
How fast will we reach equilibrium? The mean free path of a particle will be $l\approx 1/\sqrt{2} n \sigma$ where $\sigma$ is the cross section. The mean speed in the Maxwell-Boltzmann distribution is $v=\sqrt{8k_BT/\pi m}$ so the mean time for a collision will be $\tau=l/v=\sqrt{\pi m/16kTn^2\sigma^2}$ The time Equilibrium will happen after every particle have had the time to collide a few times. So if we plug in $z=1500$ we get a density $n_p+n_H = 5\times 10^9$ per cubic meter and $T=4094$ K. $m\approx m_p = 1.67262\times 10^{-27}$ kg and $\sigma\approx 10^{-20}$ square meter. This gives $\tau \approx 1.524\times 10^6$ seconds (assuming my numbers and math are correct). About 17 days - way faster than the slow transition from plasma to atomic gas. 
During nucleosynthesis this equilibration did not happen completely, partially because of the deuterium bottleneck that delayed everything. Had the process had time to continue long enough most hydrogen would have been burned into helium. Fortunately the expansion was fast enough back then to only produce some primordial helium.
