If we ignore external forces, the ocean's surface defines a geopotential surface or geoid, where the gravitational force is directly towards the centre of the Earth and there is no net lateral force and hence no flow of water.
To this, external, massive bodies such as the Moon and Sun are now added. These massive bodies have strong gravitational fields that diminish with distance in space. It is the spatial differences in these fields that deform the geoid shape. This deformation has a fixed orientation towards the influencing body and the rotation of the Earth relative to this shape drives the tides around. Gravitational forces follow the inverse-square law (force is inversely proportional to the square of the distance), but tidal forces are inversely proportional to the cube of the distance. The Sun's gravitational pull on Earth is 179 times bigger than the Moon's, but because of its much greater distance, the Sun's tidal effect is smaller than the Moon's (about 46% as strong). For simplicity, the next few sections use the word "Moon" where also "Sun" can be understood.
Tidal bulge tracking the motion of the moon. Since the Earth's crust is solid, it moves with everything inside as one whole, as defined by the force on its centre. The water at the surface is free to move following forces on its particles. It is the difference between the forces at the Earth's centre and surface which determine the effective tidal force.
At the point right "under" the Moon, the water is closer than the solid Earth; so it is pulled more and rises. On the opposite side of the Earth, facing away, the water is farther than the solid earth, so it is pulled less and moves away from Earth, rising as well. On the lateral sides, the water is pulled in a slightly different direction than at the centre. The vectorial difference with the force at the centre points almost straight inwards. It can be shown that the forces under and away from the Moon are approximately equal and that the inward forces at the sides are about half that size. Somewhere in between there is actually a point where the tidal force is parallel to the Earth's surface. Those parallel components actually contribute most to the formation of tides, since the water particles are free to follow. The actual force on a particle is only about a ten millionth of the one caused by the Earth's gravity.
These minute forces all work together: pull up under and away from the Moon, pull down at the sides, pull towards the point under or away from the Moon at intermediate points. So two bulges are formed pointing towards the Moon just under it and away from it on Earth's far side.
Tidal Amplitude and Cycle Time
Since the Earth rotates relative to the Moon in one lunar day (24 hours, 48 minutes), each of the two bulges travels around at that speed, leading to one high tide every 12 hours and 24 minutes. The theoretical amplitude of oceanic tides due to the Moon is about 54 cm at the highest point. This is the amplitude that would be reached if the ocean were uniform and Earth not rotating.
The Sun similarly causes tides, of which the theoretical amplitude is about 25 cm (46 % of that of the Moon) and the cycle time is 12 hours.
At spring tide the two effects add to each other to a theoretical level of 79 cm, while at neap tide the theoretical level is reduced to 29 cm.
Real amplitudes differ considerably, not only because of global topography as explained above, but also because the natural period of the oceans is rather large: about 30 hours (by comparison, the natural period of the Earth's crust is about 57 minutes). This means that, if the Moon suddenly vanished, the level of the oceans would oscillate with a period of 30 hours with a slowly decreasing amplitude until the stored energy dissipated completely (this 30 h value is a simple function of terrestrial gravity and the average depth of the oceans).
The distances of Earth from the Moon or the Sun vary, because the orbits are not circular, but elliptical. This causes a variation in the tidal force and theoretical amplitude of about ±18% for the Moon and ±5% for the Sun. So if both are in closest postition and aligned, the theoretical amplitude would reach 93 cm.
Because the Moon's tidal forces drive the oceans with a period of about 12.42 hours (half of the Earth's synodic period of rotation), which is considerably less than the natural period of the oceans, complex resonance phenomena take place. The lag between the Moon's passage and the tidal response varies between 2 hours in the southern oceans, to two days in the North Sea. The global average tidal lag is six hours (which means low tide occurs when the Moon is at its zenith or its nadir, a result that goes against common intuition). Tidal lag and the transfer of momentum between sea and land causes the Earth's rotation to slow down and the Moon to be moved further away in a process known as tidal acceleration.
Some other explanations in articles on the physics of tides include the (apparent) centrifugal force on the Earth in its orbit around the common centre of mass (the barycentre) with the Moon. The barycentre is located at about ¾ of the radius from the Earth's centre. It is important to note that the Earth has no "rotation" around this point. It just "displaces" around this point in a circular way. Every point on Earth has the same angular velocity and the same radius of orbit, but with a displaced centre. So the centrifugal force is uniform and does not contribute to the tides. However, this uniform centrifugal force is just equal (but with opposite sign) to the gravitational force acting on the centre of mass of Earth. So subtracting the gravitational force at the centre of Earth from the local gravitational forces at the surface, has the same effect as adding the (uniform) centrifugal forces. Although these two explanations seem very different, they yield the same results.
Tides and Navigation
Tidal flows are of profound importance in navigation and very significant errors in position will occur if tides are not taken into account. Tidal heights are also very important; for example many rivers and harbours have a shallow "bar" at the entrance which will prevent boats with significant draught from entering at certain states of the tide.
Tidal flow can be found by looking at a tidal chart for the area of interest. Tidal charts come in sets, each one of the set covering a single hour between one high tide and another (they ignore the extra 24 minutes) and give the average tidal flow for that one hour. An arrow on the tidal chart indicates direction and two numbers are given: average flow (usually in knots) for spring tides and neap tides respectively. If a tidal chart is not available, most nautical charts have "tidal diamonds" which relate specific points on the chart to a table of data giving direction and speed of tidal flow. Standard procedure is to calculate a "dead reckoning" position (or DR) from distance and direction of travel and mark this on the chart (with a vertical cross like a plus sign) and then draw in a line from the DR in the direction of the tide. Measuring the distance the tide will have moved the boat along this line then gives an "estimated position" or EP (traditionally marked with a dot in a triangle).
All nautical charts have depth markings on them which give the depth of water at that point during the lowest possible astronomical tide (tides may be lower or higher for meteorological reasons). Heights and times of low and high tide on each day are available in "tide tables". The actual depth of water at the given points at these times can then be calculated by adding the figures given to the depth given on the chart. Depths for intervening times can be calculated from tidal curves (each port has its own). If an accurate curve is not available, the rule of twelths can be used. This approximation works on the basis that the increase in depth in the six hours between low and high tide will follow this simple rule: first hour - 1/12, second - 2/12, third - 3/12, fourth - 3/12, fifth - 2/12, sixth - 1/12.