A set \(R\subset\mathbb{N}\) is called rational if for every \(\epsilon>0\) there exists \(B=\bigcup_{i=1}^ra_i\mathbb{N}+b_i\), where \(a_1,\ldots,a_r,b_1,\ldots,b_r\in\mathbb{N}\), such that \(\overline{d}(R\triangle B):=\limsup_{N\to\infty}\frac{|(R\triangle B)\cap\{1,\ldots,N\}|}{N}<\epsilon\). Examples of rational sets include the squarefree numbers, the abundant numbers and sets of the form \(\Phi_x:=\{n\in\mathbb{N}:\frac{\boldsymbol{\varphi}(n)}{n}<x\}\), where \(x\in[0,1]\) and \(\boldsymbol{\varphi}\) is Euler's totient function. We study the combinatorial and dynamical properties of rational sets and rationally almost periodic sequences (sequences whose level-sets are rational) and obtain new results in ergodic Ramsey theory. Thm: Let \(R\subset\mathbb{N}\) be rational. Assume \(\overline{d}(R)>0\). The following are equivalent: a) \(R\) is divisible, i.e. \(\overline{d}(R\cap u\mathbb{N})>0\) for all \(u\in\mathbb{N}\); b) \(R\) is an averaging set of polynomial single recurrence; c) \(R\) is an averaging set of polynomial multiple recurrence. Cor: Let \(R\subset\mathbb{N}\) be rational and divisible. Then for any \(E\subset \mathbb{N}\) with \(\overline{d}(E)>0\) and any polynomials \(p_i\in\mathbb{Q}[t]\), \(i=1,\ldots,\ell\), which satisfy \(p_i(\mathbb{Z})\subset\mathbb{Z}\) and \(p_i(0)=0\) for all \(i\in\{1,\ldots,\ell\}\), there exists \(\beta>0\) such that \(\left\{n\in R:\overline{d}\Big(E\cap (E-p_1(n))\cap\ldots\cap(E-p_\ell(n))\Big)>\beta\right\}\) has positive lower density. Thm: Let \(\mathcal{A}\) be finite and let \(\eta\in\mathcal{A}^\mathbb{N}\) be rationally almost periodic. Let \(S\) denote the left-shift on \(\mathcal{A}^\mathbb{Z}\) and let \(X:=\{y\in \mathcal{A}^\mathbb{Z}:\text{each word appearing in \)y\( appears in }\eta\}.\) Then \(\eta\) is a generic point for an \(S\)-invariant prob. measure \(\nu\) on \(X\) such that \((X,S,\nu)\) is ergodic and has rational discrete spectrum.