PLEASE NOTE that with the passage, on September 16, 2011, the US will be changing to a "First-Inventor-to-File" system--meaning that, once that change is implemented, the first to invent will no longer receive a patent UNLESS he or she is ALSO the first to file a patent application for that invention. Until the change is implemented, please use the below for reference.
Under U.S patent law, the "first-to-invent" gets the patent rights. However, this only applies if you can prove you were the first person to come up with an invention and, again, it applies only until "First-Inventor-to-File" takes effect in early 2013.
Some people believe mailing yourself a letter with your invention notes can prove your conception date. This is not true. Instead, under "first-to-invent," you should keep a detailed log book which describes the activities you took to create and test the invention. Each entry should be signed, dated and witnessed by others. In addition, each participant and his or her role should be noted.
Even with a log book, it is often difficult to prove you came up with an invention before someone else. That's why the first person to file a patent application is almost always deemed to be the first to invent, and will be unqualifiedly deemed the patent owner in the future. This is also why Provisional Applications have become so popular: they establish an official filing date.
Back in 1876, two people independently came up with an invention that could carry speech electronically over a wire - the telephone. Both men rushed their designs to the patent office, USPTO. Alexander Graham Bell beat the other man by only two hours. Bell eventually won a long legal battle and was awarded the patent for the telephone, which eventually became known as "the most valuable patent." Do you know the name of the man who came in second? Probably not. With the shift to "First-Inventor-to-File," this story should carry even more weight.