The Riley Surname
The first impression is that this is an Irish surname and although this is possible there is also an English alternative which in this case is more likely.
The Irish source is from the 10th century Gaelic O'Raghailligh, meaning the decendant of Raghallach an early personal name. This however would normally be O'Reilly
The more likely English source is based on place names and there were at least two, Riley Green in Lancashire near Blackburn or Riley Hill in Staffordshire. Given the origin of the family in my tree the Lancashire origin is possible, though the Irish one can not be ruled out.
The Riley Family
The earliest reference found so far is in the 1841 census. In the 1851 census Ann Riley had married David Ballardie, but was shown as coming from Garstang in Lancashire, something that was repeated in later censuses. Her father, John Riley, is listed in her marriage certificate as an Ostler. She is living on Cotter Street in Toxteth Park, though it is not certain if she is living with her parents at the time, though a search of Cotter Street in the 1851 census does not reveal any Riley's. Unfortunately she married just before the 1851 census so that is no help with her parents. Searching for John Riley in the 1851 census reveals over 1800 of them in Lancashire alone.
Looking in the 1841 census there is only one Ann Riley in Garstang, she is the right age, but she is living with a John Plant and Jean Martin and appears to have sisters Betty aged 13 and Isabella aged 2, it is not certain this is her. There is no sign of either John or Bella in either the 1841 or 1851 census yet Ann's marriage just prior to the census suggests John is still alive. Why these three girls should have been living with an unmarried couple with a child of thier own is a mystery, it can only be assumed there is some relationship there. There are submitted entries in the IGI that suggest John Riley married Bella Banks in Kirkham, Lancashire in 1826 (This is about 10 miles from Garstang) and they had three children Elizabeth, Ann and Isabella, but information needs validating, only Isabella was born after 1837 when records started and she is the only one listed for a fact, though as yet her birth certificate has not been obtained to find out if this is the correct one. In 1851 Elizabeth appears to be a house servant with the Smith family in Garstang.
More research will have to be done on this line.